diff options
author | Stef Walter <stef@memberwebs.com> | 2006-04-05 21:59:42 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2006-04-05 21:59:42 +0000 |
commit | 847578bd4fa3f5bead0bd272c2347ca9f96e5abd (patch) | |
tree | 20e879604da76e8e12a4de55a1ed39c380b6ea5c /tools/rrdui-cgi.py | |
parent | c6e0f00687bcef76d2ce325e9489aba9b3c3da2a (diff) |
Add autoscrolling for graphs. See #67
Diffstat (limited to 'tools/rrdui-cgi.py')
-rwxr-xr-x | tools/rrdui-cgi.py | 43 |
1 files changed, 5 insertions, 38 deletions
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 " <category name=\"%s\">" % group categories[group].sort() for item in categories[group]: - print " <graph name=\"%s\" width=\"%d\" height=\"%d\" title=\"%s\"/>" % \ - (item.name, item.width, item.height, item.title) + print " <graph name=\"%s\" width=\"%d\" height=\"%d\" title=\"%s\" interval=\"%s\"/>" % \ + (item.name, item.width, item.height, item.title, item.interval) print " </category>" print "</data>" |