]> git.ipfire.org Git - collecty.git/blobdiff - src/collecty/plugins/sensors.py
sensors: Make the lines less fat
[collecty.git] / src / collecty / plugins / sensors.py
index 1fd4b19b043ddf3f8c7658f9c6acf7138051e3e1..8e890a90ebdd1af4351a88fd77e56386200cd39d 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()
@@ -138,8 +145,8 @@ class GraphTemplateSensorsProcessorTemperature(base.GraphTemplate):
                        "CDEF:all_value_c_high=all_value_c,all_high_c,GT,all_value_c,UNKN,IF",
                        "CDEF:all_value_c_normal=all_value_c,all_high_c,GT,UNKN,all_value_c,IF",
 
-                       "LINE3:all_value_c_high#FF0000",
-                       "LINE3:all_value_c_normal#000000:%-15s\l" % _("Temperature"),
+                       "LINE2:all_value_c_high#FF0000",
+                       "LINE2:all_value_c_normal#000000:%-15s\l" % _("Temperature"),
 
                        "GPRINT:all_value_c_avg:    %-15s %%6.2lf °C\l" % _("Average"),
                        "GPRINT:all_value_c_max:    %-15s %%6.2lf °C\l" % _("Maximum"),
@@ -150,7 +157,7 @@ class GraphTemplateSensorsProcessorTemperature(base.GraphTemplate):
                        rrd_graph += [
                                # TODO these lines were supposed to be dashed, but that
                                # didn't really work here
-                               "LINE2:%s_value_c%s:%-10s" % (id, colour, core.sensor.label),
+                               "LINE1:%s_value_c%s:%-10s" % (id, colour, core.sensor.label),
                        ]
 
                # Draw the critical line