]> git.ipfire.org Git - oddments/collecty.git/blobdiff - src/collecty/plugins/loadavg.py
Allow the plugins to return the results as a tuple or list
[oddments/collecty.git] / src / collecty / plugins / loadavg.py
index b8cf07a5e4fc07f8bb9f70248b50e0f20d9381e7..24cce740ebf334c51248edff858e6535d6bbf3bb 100644 (file)
@@ -61,12 +61,15 @@ class GraphTemplateLoadAvg(base.GraphTemplate):
                "LINE:load1#dd0000",
        ]
 
-       rrd_graph_args = [
-               "--title", _("Load average"),
-               "--vertical-label", _("Load"),
+       lower_limit = 0
 
-               "--lower-limit", "0", "--rigid",
-       ]
+       @property
+       def graph_title(self):
+               return _("Load average")
+
+       @property
+       def graph_vertical_label(self):
+               return _("Load")
 
 
 class LoadAvgObject(base.Object):
@@ -81,7 +84,7 @@ class LoadAvgObject(base.Object):
                return "default"
 
        def collect(self):
-               return ":".join(["%.10f" % l for l in os.getloadavg()])
+               return os.getloadavg()
 
 
 class LoadAvgPlugin(base.Plugin):