From 847578bd4fa3f5bead0bd272c2347ca9f96e5abd Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 5 Apr 2006 21:59:42 +0000 Subject: Add autoscrolling for graphs. See #67 --- tools/rrdui-cgi.py | 43 +++++-------------------------------------- 1 file changed, 5 insertions(+), 38 deletions(-) (limited to 'tools') diff --git a/tools/rrdui-cgi.py b/tools/rrdui-cgi.py index 7390547..1584555 100755 --- a/tools/rrdui-cgi.py +++ b/tools/rrdui-cgi.py @@ -35,6 +35,7 @@ class GraphDef: self.filedata = "%s/%s.rrd" % (WORKDIR, name) self.category = "All" self.name = name + self.interval = 0 self.valid = False cfg = self.__config = ConfigParser.RawConfigParser() @@ -59,43 +60,9 @@ class GraphDef: self.options = cfg.get("graph", "options") self.valid = True - - def getCreateInfo(self): - cfg = self.__config - rra = None - fields = {} - - # The RRA info - if cfg.has_option("create", "rra"): - rra = cfg.get("create", "rra").split() - - # The various fields - for field in cfg.options("create"): - if not field.startswith("field."): - continue - fieldname = field[6:] - fields[fieldname] = cfg.get("create", field) - - return (fields, rra) - - - def getPollingInfo(self): - cfg = self.__config - interval = 300 - fields = {} - - # The interval + # Polling stuff if cfg.has_option("poll", "interval"): - interval = int(cfg.get("poll", "interval")) - - # The various fields - for field in cfg.options("poll"): - if not field.startswith("field."): - continue - fieldname = field[6:] - fields[fieldname] = cfg.get("poll", field) - - return (fields, interval) + self.interval = cfg.get("poll", "interval") def loadGraphs(path = ""): @@ -132,8 +99,8 @@ def listGraphs(): print " " % group categories[group].sort() for item in categories[group]: - print " " % \ - (item.name, item.width, item.height, item.title) + print " " % \ + (item.name, item.width, item.height, item.title, item.interval) print " " print "" -- cgit v1.2.3