3 * Copyright (C) 2015 IPFire Team (www.ipfire.org)
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include <linux/hdreg.h>
25 #include <sensors/error.h>
26 #include <sensors/sensors.h>
29 #define SERIAL_SIZE 20
31 #define PING_HISTORY_SIZE 1024
32 #define PING_DEFAULT_COUNT 10
33 #define PING_DEFAULT_TIMEOUT 8
39 struct hd_driveid identity
;
43 PyTypeObject BlockDeviceType
;
45 void BlockDevice_dealloc(BlockDevice
* self
);
46 int BlockDevice_get_identity(BlockDevice
* device
);
47 int BlockDevice_smart_is_available(BlockDevice
* device
);
48 int BlockDevice_check_sleep_mode(BlockDevice
* device
);
49 PyObject
* BlockDevice_new(PyTypeObject
* type
, PyObject
* args
, PyObject
* kwds
);
50 int BlockDevice_init(BlockDevice
* self
, PyObject
* args
, PyObject
* kwds
);
51 PyObject
* BlockDevice_get_path(PyObject
* self
);
52 PyObject
* BlockDevice_get_model(PyObject
* self
);
53 PyObject
* BlockDevice_get_serial(PyObject
* self
);
54 PyObject
* BlockDevice_is_smart_supported(PyObject
* self
);
55 PyObject
* BlockDevice_is_awake(PyObject
* self
);
56 PyObject
* BlockDevice_get_bad_sectors(PyObject
* self
);
57 PyObject
* BlockDevice_get_temperature(PyObject
* self
);
60 PyObject
* PyExc_PingError
;
61 PyObject
* PyExc_PingAddHostError
;
68 double history
[PING_HISTORY_SIZE
];
79 PyTypeObject PingType
;
81 void Ping_dealloc(PingObject
* self
);
82 void Ping_init_stats(PingObject
* self
);
83 PyObject
* Ping_new(PyTypeObject
* type
, PyObject
* args
, PyObject
* kwds
);
84 int Ping_init(PingObject
* self
, PyObject
* args
, PyObject
* kwds
);
85 double Ping_compute_average(PingObject
* self
);
86 double Ping_compute_stddev(PingObject
* self
, double mean
);
87 PyObject
* Ping_ping(PingObject
* self
, PyObject
* args
, PyObject
* kwds
);
88 PyObject
* Ping_get_packets_sent(PingObject
* self
);
89 PyObject
* Ping_get_packets_rcvd(PingObject
* self
);
90 PyObject
* Ping_get_average(PingObject
* self
);
91 PyObject
* Ping_get_stddev(PingObject
* self
);
92 PyObject
* Ping_get_loss(PingObject
* self
);
97 const sensors_chip_name
* chip
;
98 const sensors_feature
* feature
;
101 PyTypeObject SensorType
;
103 void Sensor_dealloc(SensorObject
* self
);
104 PyObject
* Sensor_new(PyTypeObject
* type
, PyObject
* args
, PyObject
* kwds
);
105 int Sensor_init(SensorObject
* self
, PyObject
* args
, PyObject
* kwds
);
106 PyObject
* Sensor_get_label(SensorObject
* self
);
107 PyObject
* Sensor_get_name(SensorObject
* self
);
108 PyObject
* Sensor_get_type(SensorObject
* self
);
109 PyObject
* Sensor_get_bus(SensorObject
* self
);
110 PyObject
* Sensor_return_value(SensorObject
* sensor
, sensors_subfeature_type subfeature_type
);
111 PyObject
* Sensor_get_value(SensorObject
* self
);
112 PyObject
* Sensor_get_critical(SensorObject
* self
);
113 PyObject
* Sensor_get_maximum(SensorObject
* self
);
114 PyObject
* Sensor_get_minimum(SensorObject
* self
);
115 PyObject
* Sensor_get_high(SensorObject
* self
);
117 PyObject
* _collecty_sensors_init();
118 PyObject
* _collecty_sensors_cleanup();
119 PyObject
* _collecty_get_detected_sensors(PyObject
* o
, PyObject
* args
);
122 int _collecty_mountpoint_is_virtual(const struct mntent
* mp
);
123 PyObject
* _collecty_get_mountpoints();