From 971ad5c8dfce9f8bf2ada202e1b19c7f6f6dba48 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 26 Oct 2015 18:15:12 +0100 Subject: [PATCH] entropy: Localise plugin Signed-off-by: Michael Tremer --- src/collecty/plugins/entropy.py | 34 +++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/collecty/plugins/entropy.py b/src/collecty/plugins/entropy.py index 0b3fa5a..7dcb418 100644 --- a/src/collecty/plugins/entropy.py +++ b/src/collecty/plugins/entropy.py @@ -30,29 +30,35 @@ ENTROPY_FILE = "/proc/sys/kernel/random/entropy_avail" class GraphTemplateEntropy(base.GraphTemplate): name = "entropy" - rrd_graph = [ - "DEF:entropy=%(file)s:entropy:AVERAGE", - "CDEF:entropytrend=entropy,43200,TREND", - - "LINE3:entropy#ff0000:%-15s" % _("Available entropy"), - "VDEF:entrmin=entropy,MINIMUM", - "VDEF:entrmax=entropy,MAXIMUM", - "VDEF:entravg=entropy,AVERAGE", - "GPRINT:entrmax:%12s\:" % _("Maximum") + " %5.0lf", - "GPRINT:entrmin:%12s\:" % _("Minimum") + " %5.0lf", - "GPRINT:entravg:%12s\:" % _("Average") + " %5.0lf\\n", - - "LINE3:entropytrend#000000", - ] + @property + def rrd_graph(self): + _ = self.locale.translate + + return [ + "DEF:entropy=%(file)s:entropy:AVERAGE", + "CDEF:entropytrend=entropy,43200,TREND", + + "LINE3:entropy#ff0000:%-15s" % _("Available entropy"), + "VDEF:entrmin=entropy,MINIMUM", + "VDEF:entrmax=entropy,MAXIMUM", + "VDEF:entravg=entropy,AVERAGE", + "GPRINT:entrmax:%12s\:" % _("Maximum") + " %5.0lf", + "GPRINT:entrmin:%12s\:" % _("Minimum") + " %5.0lf", + "GPRINT:entravg:%12s\:" % _("Average") + " %5.0lf\\n", + + "LINE3:entropytrend#000000", + ] lower_limit = 0 @property def graph_title(self): + _ = self.locale.translate return _("Available entropy") @property def graph_vertical_label(self): + _ = self.locale.translate return _("Bit") -- 2.47.2