summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 204cf4f)
raw | patch | inline | side by side (parent: 204cf4f)
author | Jan Kundrát <jan.kundrat@cesnet.cz> | |
Wed, 26 Feb 2014 14:45:01 +0000 (15:45 +0100) | ||
committer | Jan Kundrát <jan.kundrat@cesnet.cz> | |
Wed, 26 Feb 2014 14:47:36 +0000 (15:47 +0100) |
The patch shall probably be extended to include additional sensor names in
future. My servers, however, use "power1" for all of the readings, so I'm not
making that change now.
future. My servers, however, use "power1" for all of the readings, so I'm not
making that change now.
src/sensors.c | patch | blob | history |
diff --git a/src/sensors.c b/src/sensors.c
index 209482e09f88e37a536641bda22d71e2d71810b4..842499d7c283d523a814b714015745ac6012b0a1 100644 (file)
--- a/src/sensors.c
+++ b/src/sensors.c
"fanspeed",
# define SENSOR_TYPE_TEMPERATURE 2
"temperature",
-# define SENSOR_TYPE_UNKNOWN 3
+# define SENSOR_TYPE_POWER 3
+ "power",
+# define SENSOR_TYPE_UNKNOWN 4
NULL
};
{ "3.3V", SENSOR_TYPE_VOLTAGE },
{ "2.5V", SENSOR_TYPE_VOLTAGE },
{ "2.0V", SENSOR_TYPE_VOLTAGE },
- { "12V", SENSOR_TYPE_VOLTAGE }
+ { "12V", SENSOR_TYPE_VOLTAGE },
+ { "power1", SENSOR_TYPE_POWER }
};
static int known_features_num = STATIC_ARRAY_SIZE (known_features);
/* end new naming */
/* Only handle voltage, fanspeeds and temperatures */
if ((feature->type != SENSORS_FEATURE_IN)
&& (feature->type != SENSORS_FEATURE_FAN)
- && (feature->type != SENSORS_FEATURE_TEMP))
+ && (feature->type != SENSORS_FEATURE_TEMP)
+ && (feature->type != SENSORS_FEATURE_POWER))
{
DEBUG ("sensors plugin: sensors_load_conf: "
"Ignoring feature `%s', "
if ((subfeature->type != SENSORS_SUBFEATURE_IN_INPUT)
&& (subfeature->type != SENSORS_SUBFEATURE_FAN_INPUT)
- && (subfeature->type != SENSORS_SUBFEATURE_TEMP_INPUT))
+ && (subfeature->type != SENSORS_SUBFEATURE_TEMP_INPUT)
+ && (subfeature->type != SENSORS_SUBFEATURE_POWER_INPUT))
continue;
fl = (featurelist_t *) malloc (sizeof (featurelist_t));
else if (fl->feature->type
== SENSORS_FEATURE_TEMP)
type = "temperature";
+ else if (fl->feature->type
+ == SENSORS_FEATURE_POWER)
+ type = "power";
else
continue;