summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/rrdui-cgi.py43
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>"