summaryrefslogtreecommitdiffstats
path: root/abs/core/xymon/hbnotes.py
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2014-10-26 17:03:56 (GMT)
committerJames Meyer <james.meyer@operamail.com>2014-10-26 17:04:15 (GMT)
commit525bfed2bec6b2671ad3a82aa88b9baf1b01111c (patch)
tree7445fecdca304db3357508b8db944797a2c32d43 /abs/core/xymon/hbnotes.py
parent8ed6e49baf804f8e0cfc0ebd00d659e944c79746 (diff)
downloadlinhes_pkgbuild-525bfed2bec6b2671ad3a82aa88b9baf1b01111c.zip
linhes_pkgbuild-525bfed2bec6b2671ad3a82aa88b9baf1b01111c.tar.gz
linhes_pkgbuild-525bfed2bec6b2671ad3a82aa88b9baf1b01111c.tar.bz2
xymon: add gputemp.sh, fix permissions, and add some extra try/except to hbnotes
refs #979
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>