diff options
author | Rob Austein <sra@hactrn.net> | 2012-07-03 00:47:10 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2012-07-03 00:47:10 +0000 |
commit | f85d9f9f5ae2174ea642af85960b8a05a89c316c (patch) | |
tree | 938aea7178d28abbbd66f38c23b8f77a5d3b5002 /rcynic | |
parent | 4df01c08e51dfc0f7a889805ad197f2fd950dcfa (diff) |
Add EPS support and other tweaks to simplify incorporating output from
this program in slide decks.
svn path=/trunk/; revision=4564
Diffstat (limited to 'rcynic')
-rw-r--r-- | rcynic/rcynic-html.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/rcynic/rcynic-html.py b/rcynic/rcynic-html.py index 65567107..f4b11ca6 100644 --- a/rcynic/rcynic-html.py +++ b/rcynic/rcynic-html.py @@ -35,14 +35,15 @@ session = None opt = { "refresh" : 1800, - "show-detailed-status" : True, - "show-problems" : False, + "show-problems" : True, "show-graphs" : True, "update-rrds" : True, "png-height" : 190, "png-width" : 1350, "svg-height" : 600, - "svg-width" : 1200 } + "svg-width" : 1200, + "eps-height" : 0, + "eps-width" : 0 } try: # Set from autoconf @@ -335,8 +336,10 @@ class Host(Problem_Mixin): def rrd_graph(self, html): filebase = os.path.join(opt["output_directory"], self.hostname) + formats = [format for format in ("png", "svg", "eps") + if opt[format + "-width"] and opt[format + "-height"]] for period, start in self.graph_periods: - for format in ("png", "svg"): + for format in formats: cmds = [ "graph", "%s_%s.%s" % (filebase, period, format), "--title", "%s last %s" % (self.hostname, period), "--start", start, @@ -634,10 +637,11 @@ def main(): html.counter_table(session.hosts[hostname].get_counter, session.hosts[hostname].get_total) if opt["show-graphs"]: session.hosts[hostname].rrd_graph(html) - html.BodyElement("h2").text = "Connection Problems" - html.detail_table(session.hosts[hostname].connection_problems) - html.BodyElement("h2").text = "Object Problems" - html.detail_table(session.hosts[hostname].object_problems) + if opt["show-problems"]: + html.BodyElement("h2").text = "Connection Problems" + html.detail_table(session.hosts[hostname].connection_problems) + html.BodyElement("h2").text = "Object Problems" + html.detail_table(session.hosts[hostname].object_problems) html.close() html = HTML("rcynic summary", "index") |