sensors: Fall back to ACPI temperature sensor to processor temperature
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 15 Dec 2015 22:51:29 +0000 (22:51 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 15 Dec 2015 22:51:29 +0000 (22:51 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/collecty/plugins/sensors.py

index 1fd4b19..e832be8 100644 (file)
@@ -93,7 +93,14 @@ class GraphTemplateSensorsProcessorTemperature(base.GraphTemplate):
        ]
 
        def get_temperature_sensors(self):
-               return self.plugin.get_detected_sensor_objects("coretemp-*")
+               # Use the coretemp module if available
+               sensors = self.plugin.get_detected_sensor_objects("coretemp-*")
+
+               # Fall back to the ACPI sensor
+               if not sensors:
+                       sensors = self.plugin.get_detected_sensor_objects("acpitz-virtual-*")
+
+               return sensors
 
        def get_objects(self, *args, **kwargs):
                sensors = self.get_temperature_sensors()