from . import base
+from ..colours import *
from ..i18n import _
class GraphTemplateDiskBadSectors(base.GraphTemplate):
_ = self.locale.translate
return [
- "AREA:bad_sectors#ff0000:%s" % _("Bad Sectors"),
+ "AREA:bad_sectors%s:%s" % (COLOUR_CRITICAL,_("Bad Sectors")),
"GPRINT:bad_sectors_cur:%12s\:" % _("Current") + " %9.2lf",
"GPRINT:bad_sectors_max:%12s\:" % _("Maximum") + " %9.2lf\\n",
]
"CDEF:read_bytes=read_sectors,512,*",
"CDEF:write_bytes=write_sectors,512,*",
- "LINE1:read_bytes#ff0000:%-15s" % _("Read"),
+ "LINE1:read_bytes%s:%-15s" % (COLOUR_READ, _("Read")),
"GPRINT:read_bytes_cur:%12s\:" % _("Current") + " %9.2lf",
"GPRINT:read_bytes_max:%12s\:" % _("Maximum") + " %9.2lf",
"GPRINT:read_bytes_min:%12s\:" % _("Minimum") + " %9.2lf",
"GPRINT:read_bytes_avg:%12s\:" % _("Average") + " %9.2lf\\n",
- "LINE1:write_bytes#00ff00:%-15s" % _("Written"),
+ "LINE1:write_bytes%s:%-15s" % (COLOUR_WRITE, _("Written")),
"GPRINT:write_bytes_cur:%12s\:" % _("Current") + " %9.2lf",
"GPRINT:write_bytes_max:%12s\:" % _("Maximum") + " %9.2lf",
"GPRINT:write_bytes_min:%12s\:" % _("Minimum") + " %9.2lf",
_ = self.locale.translate
rrd_graph = [
- "LINE1:read_ios#ff0000:%-15s" % _("Read"),
+ "LINE1:read_ios%s:%-15s" % (COLOUR_READ, _("Read")),
"GPRINT:read_ios_cur:%12s\:" % _("Current") + " %6.2lf",
"GPRINT:read_ios_max:%12s\:" % _("Maximum") + " %6.2lf",
"GPRINT:read_ios_min:%12s\:" % _("Minimum") + " %6.2lf",
"GPRINT:read_ios_avg:%12s\:" % _("Average") + " %6.2lf\\n",
- "LINE1:write_ios#00ff00:%-15s" % _("Written"),
+ "LINE1:write_ios%s:%-15s" % (COLOUR_WRITE, _("Written")),
"GPRINT:write_ios_cur:%12s\:" % _("Current") + " %6.2lf",
"GPRINT:write_ios_max:%12s\:" % _("Maximum") + " %6.2lf",
"GPRINT:write_ios_min:%12s\:" % _("Minimum") + " %6.2lf",
"VDEF:temp_max=celsius,MAXIMUM",
"VDEF:temp_avg=celsius,AVERAGE",
- "LINE2:celsius#ff0000:%s" % _("Temperature"),
+ "LINE2:celsius%s:%s" % (PRIMARY, _("Temperature")),
"GPRINT:temp_cur:%12s\:" % _("Current") + " %3.2lf",
"GPRINT:temp_max:%12s\:" % _("Maximum") + " %3.2lf",
"GPRINT:temp_min:%12s\:" % _("Minimum") + " %3.2lf",
if not self.is_smart_supported():
return "NaN"
- return self.device.get_temperature()
+ try:
+ return self.device.get_temperature()
+ except OSError:
+ return "NaN"
def get_bad_sectors(self):
if not self.is_smart_supported():