From: Stephen Soltesz Date: Tue, 20 May 2008 19:43:20 +0000 (+0000) Subject: For dumping the diagnose_out file. X-Git-Tag: Monitor-1.0-5~15 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=ab01beea0bd8b23a65c48fdecf21b3bd9bf75ad9;p=monitor.git For dumping the diagnose_out file. --- diff --git a/dumpdiag.py b/dumpdiag.py new file mode 100755 index 0000000..bed95dc --- /dev/null +++ b/dumpdiag.py @@ -0,0 +1,41 @@ +#!/usr/bin/python + +# Read in the act_* databases and print out a human readable version + +import sys +import time +import getopt +import soltesz + +def main(): + + sickdb = soltesz.dbLoad(sys.argv[1]) + plcdb_hn2lb = soltesz.dbLoad("plcdb_hn2lb") + s_nodenames = "" + + sorted_keys = sickdb.keys() + sorted_keys.sort() + print "anything" + print len(sorted_keys) + for loginbase in sorted_keys: + print loginbase + nodedict = sickdb[loginbase]['nodes'] + sort_nodekeys = nodedict.keys() + sort_nodekeys.sort() + print "%s :" % loginbase + for nodename in sort_nodekeys: + diag_node = sickdb[loginbase]['nodes'][nodename] + keys = diag_node.keys() + keys.sort() + print nodename + for k in keys: + #print k + if "message" not in k and "msg" not in k: + print "\t'%s' : %s" % (k, diag_node[k]) + print "\t--" + + print s_nodenames + + +if __name__ == '__main__': + main()