summaryrefslogtreecommitdiffstats
path: root/abs/core/xymon/hbnotes.py
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/xymon/hbnotes.py')
-rwxr-xr-xabs/core/xymon/hbnotes.py64
1 files changed, 35 insertions, 29 deletions
diff --git a/abs/core/xymon/hbnotes.py b/abs/core/xymon/hbnotes.py
index b12cc7b..d14d62a 100755
--- a/abs/core/xymon/hbnotes.py
+++ b/abs/core/xymon/hbnotes.py
@@ -122,44 +122,46 @@ def create_dot_file():
#----------------------------------Create graphviz dot files
dotfilename="/home/xymon/server/etc/mythdot"
+ try:
+ dotfile=open(dotfilename,'w')
+ dotfile.write("digraph G { " + "\n" )
+ dotfile.write("graph [bgcolor=transparent]" + "\n" )
+ #print tunerdict
- dotfile=open(dotfilename,'w')
- dotfile.write("digraph G { " + "\n" )
- dotfile.write("graph [bgcolor=transparent]" + "\n" )
- #print tunerdict
-
- #define the nodes
- dotfile.write( dotMBE + " \n" )
+ #define the nodes
+ dotfile.write( dotMBE + " \n" )
- dotfile.write("tunermbe"+ " [ label= \"" + tunerdict["MBE"] + "\" , shapefile=\"/data/srv/httpd/htdocs/xymon/gifs/tuner.png\" fontcolor=\"white\" color=red ] \n" )
+ dotfile.write("tunermbe"+ " [ label= \"" + tunerdict["MBE"] + "\" , shapefile=\"/data/srv/httpd/htdocs/xymon/gifs/tuner.png\" fontcolor=\"white\" color=red ] \n" )
- for fe in dotfrontend:
- dotfile.write("FEND"+fe + "[ label=\"frontend \\n " + fe + "\" ,shapefile=\"/data/srv/httpd/htdocs/xymon/gifs/tv.png\" , fontcolor=\"white\" , imagescale=\"true\" color=\"gold2\" ] \n" )
+ for fe in dotfrontend:
+ dotfile.write("FEND"+fe + "[ label=\"frontend \\n " + fe + "\" ,shapefile=\"/data/srv/httpd/htdocs/xymon/gifs/tv.png\" , fontcolor=\"white\" , imagescale=\"true\" color=\"gold2\" ] \n" )
- for fe in dotslave:
- cslave="STUNER"+fe
- #adding tuners to dot file
- if tunerdict[cslave] != "" :
- dotfile.write(cslave+ " [ label= \"" + tunerdict[cslave] + "\" , shapefile=\"/data/srv/httpd/htdocs/xymon/gifs/tuner.png\" fontcolor=\"white\" color=red ] \n" )
- #adding slave to dot file
- dotfile.write("SLAVE"+fe + "[ label=\"slave backend \\n " + fe + "\" shapefile=\"/data/srv/httpd/htdocs/xymon/gifs/be.png\" fontcolor=\"white\" color=green ] \n" )
+ for fe in dotslave:
+ cslave="STUNER"+fe
+ #adding tuners to dot file
+ if tunerdict[cslave] != "" :
+ dotfile.write(cslave+ " [ label= \"" + tunerdict[cslave] + "\" , shapefile=\"/data/srv/httpd/htdocs/xymon/gifs/tuner.png\" fontcolor=\"white\" color=red ] \n" )
+ #adding slave to dot file
+ dotfile.write("SLAVE"+fe + "[ label=\"slave backend \\n " + fe + "\" shapefile=\"/data/srv/httpd/htdocs/xymon/gifs/be.png\" fontcolor=\"white\" color=green ] \n" )
- #connect up the nodes!
- dotfile.write("tunermbe -> MBE [color=\"red\"] \n " )
+ #connect up the nodes!
+ dotfile.write("tunermbe -> MBE [color=\"red\"] \n " )
- for fe in dotfrontend:
- dotfile.write("MBE -> FEND" + fe + "[color=\"gold2\"] \n " )
+ for fe in dotfrontend:
+ dotfile.write("MBE -> FEND" + fe + "[color=\"gold2\"] \n " )
- for fe in dotslave:
- cslave="STUNER"+fe
- dotfile.write("SLAVE" + fe + "-> MBE [color=\"green\"] \n " )
- if tunerdict[cslave] != "" :
- dotfile.write(cslave + "-> SLAVE"+fe + "[color=\"red\"]" "\n" )
+ for fe in dotslave:
+ cslave="STUNER"+fe
+ dotfile.write("SLAVE" + fe + "-> MBE [color=\"green\"] \n " )
+ if tunerdict[cslave] != "" :
+ dotfile.write(cslave + "-> SLAVE"+fe + "[color=\"red\"]" "\n" )
- dotfile.write("} " + "\n" )
- dotfile.close()
+ dotfile.write("} " + "\n" )
+ dotfile.close()
+ except:
+ print "Problem writing %s" %dotfilename
cmd="/usr/bin/unflatten -l1 -c3 -f " + dotfilename + " |/usr/bin/dot -Tpng -o/data/srv/httpd/htdocs/xymon/gifs/network.png "
@@ -248,8 +250,12 @@ def create_notes():
filename="/home/xymon/server/www/notes/"
filename+=str(row[0])
filename+=(".html")
+ try:
+ file = open(filename,'w')
+ except:
+ print "problem opening %s" %filename
+ continue
- file = open(filename,'w')
string='''
<html>
<head> <style type="text/css">@import "/frame.css";</style>