]> git.ipfire.org Git - collecty.git/blobdiff - src/collecty/plugins/latency.py
graph templates: Make some atttibutes easier to set
[collecty.git] / src / collecty / plugins / latency.py
index 98e69366a155dc137c24901011f778a171cdc7fe..a6db8d0bd29bb9d56132020eb79a691518007b15 100644 (file)
@@ -32,6 +32,8 @@ PING_HOSTS = [
 class GraphTemplateLatency(base.GraphTemplate):
        name = "latency"
 
+       lower_limit = 0
+
        @property
        def rrd_graph(self):
                return [
@@ -73,13 +75,12 @@ class GraphTemplateLatency(base.GraphTemplate):
                ]
 
        @property
-       def rrd_graph_args(self):
-               return [
-                       "--title", _("Latency to %(host)s"),
-                       "--vertical-label", _("Milliseconds"),
+       def graph_title(self):
+               return _("Latency to %(host)s")
 
-                       "--lower-limit", "0", "--rigid",
-               ]
+       @property
+       def graph_vertical_label(self):
+               return _("Milliseconds")
 
 
 class LatencyObject(base.Object):
@@ -105,7 +106,7 @@ class LatencyObject(base.Object):
                try:
                        ping = collecty.ping.Ping(destination=self.hostname, timeout=20000)
                        ping.run(count=5, deadline=self.deadline)
-       
+
                except collecty.ping.PingError, e:
                        self.log.warning(_("Could not run latency check for %(host)s: %(msg)s") \
                                % { "host" : self.hostname, "msg" : e.msg })
@@ -122,7 +123,7 @@ class LatencyPlugin(base.Plugin):
        name = "latency"
        description = "Latency (ICMP ping) Plugin"
 
-       templates = [GraphTemplateLatency,]
+       templates = [GraphTemplateLatency]
 
        interval = 60