class GraphTemplateSensorsTemperature(base.GraphTemplate):
name = "sensors-temperature"
- rrd_graph = [
- "DEF:value_kelvin=%(file)s:value:AVERAGE",
- "DEF:critical_kelvin=%(file)s:critical:AVERAGE",
- "DEF:high_kelvin=%(file)s:high:AVERAGE",
- "DEF:low_kelvin=%(file)s:low:AVERAGE",
-
- # Convert everything to celsius
- "CDEF:value=value_kelvin,273.15,-",
- "CDEF:critical=critical_kelvin,273.15,-",
- "CDEF:high=high_kelvin,273.15,-",
- "CDEF:low=low_kelvin,273.15,-",
-
- # Change colour when the value gets above high
- "CDEF:value_high=value,high,GT,value,UNKN,IF",
- "CDEF:value_normal=value,high,GT,UNKN,value,IF",
-
- "VDEF:value_cur=value,LAST",
- "VDEF:value_avg=value,AVERAGE",
- "VDEF:value_max=value,MAXIMUM",
- "VDEF:value_min=value,MINIMUM",
-
- # Get data points for the threshold lines
- "VDEF:critical_line=critical,MINIMUM",
- "VDEF:low_line=low,MAXIMUM",
-
- # Draw the temperature value
- "LINE3:value_high#ff0000",
- "LINE2:value_normal#00ff00:%-15s" % _("Temperature"),
-
- # Draw the legend
- "GPRINT:value_cur:%%10.2lf °C\l",
- "GPRINT:value_avg: %-15s %%6.2lf °C\l" % _("Average"),
- "GPRINT:value_max: %-15s %%6.2lf °C\l" % _("Maximum"),
- "GPRINT:value_min: %-15s %%6.2lf °C\l" % _("Minimum"),
-
- # Empty line
- "COMMENT: \\n",
-
- # Draw boundary lines
- "COMMENT:%s\:" % _("Temperature Thresholds"),
- "HRULE:critical_line#000000:%-15s" % _("Critical"),
- "GPRINT:critical_line:%%6.2lf °C\\r",
- "HRULE:low_line#0000ff:%-15s" % _("Low"),
- "GPRINT:low_line:%%6.2lf °C\\r",
- ]
+ @property
+ def rrd_graph(self):
+ _ = self.locale.translate
+
+ return [
+ "DEF:value_kelvin=%(file)s:value:AVERAGE",
+ "DEF:critical_kelvin=%(file)s:critical:AVERAGE",
+ "DEF:high_kelvin=%(file)s:high:AVERAGE",
+ "DEF:low_kelvin=%(file)s:low:AVERAGE",
+
+ # Convert everything to celsius
+ "CDEF:value=value_kelvin,273.15,-",
+ "CDEF:critical=critical_kelvin,273.15,-",
+ "CDEF:high=high_kelvin,273.15,-",
+ "CDEF:low=low_kelvin,273.15,-",
+
+ # Change colour when the value gets above high
+ "CDEF:value_high=value,high,GT,value,UNKN,IF",
+ "CDEF:value_normal=value,high,GT,UNKN,value,IF",
+
+ "VDEF:value_cur=value,LAST",
+ "VDEF:value_avg=value,AVERAGE",
+ "VDEF:value_max=value,MAXIMUM",
+ "VDEF:value_min=value,MINIMUM",
+
+ # Get data points for the threshold lines
+ "VDEF:critical_line=critical,MINIMUM",
+ "VDEF:low_line=low,MAXIMUM",
+
+ # Draw the temperature value
+ "LINE3:value_high#ff0000",
+ "LINE2:value_normal#00ff00:%-15s" % _("Temperature"),
+
+ # Draw the legend
+ "GPRINT:value_cur:%%10.2lf °C\l",
+ "GPRINT:value_avg: %-15s %%6.2lf °C\l" % _("Average"),
+ "GPRINT:value_max: %-15s %%6.2lf °C\l" % _("Maximum"),
+ "GPRINT:value_min: %-15s %%6.2lf °C\l" % _("Minimum"),
+
+ # Empty line
+ "COMMENT: \\n",
+
+ # Draw boundary lines
+ "COMMENT:%s\:" % _("Temperature Thresholds"),
+ "HRULE:critical_line#000000:%-15s" % _("Critical"),
+ "GPRINT:critical_line:%%6.2lf °C\\r",
+ "HRULE:low_line#0000ff:%-15s" % _("Low"),
+ "GPRINT:low_line:%%6.2lf °C\\r",
+ ]
@property
def graph_title(self):
+ _ = self.locale.translate
return _("Temperature (%s)") % self.object.sensor.name
@property
def graph_vertical_label(self):
+ _ = self.locale.translate
return _("° Celsius")
@property
def rrd_graph(self):
+ _ = self.locale.translate
rrd_graph = []
cores = sorted(self.object_table.keys())
@property
def graph_title(self):
+ _ = self.locale.translate
return _("Processor")
@property
def graph_vertical_label(self):
+ _ = self.locale.translate
return _("Temperature")