git://git.onelab.eu
/
monitor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6705781
)
Add a field for the currently observed status as well as the PLC db
author
Stephen Soltesz
<soltesz@cs.princeton.edu>
Mon, 14 Apr 2008 17:59:45 +0000
(17:59 +0000)
committer
Stephen Soltesz
<soltesz@cs.princeton.edu>
Mon, 14 Apr 2008 17:59:45 +0000
(17:59 +0000)
configuration.
nodegroups.py
patch
|
blob
|
history
diff --git
a/nodegroups.py
b/nodegroups.py
index
92465d0
..
7ec1dde
100755
(executable)
--- a/
nodegroups.py
+++ b/
nodegroups.py
@@
-20,6
+20,15
@@
api = plc.PLC(auth.auth, auth.plc)
from config import config
from optparse import OptionParser
from config import config
from optparse import OptionParser
+import soltesz
+fb = soltesz.dbLoad("findbad")
+
+def get_current_state(fbnode):
+ state = fbnode['state']
+ l = state.lower()
+ if l == "debug": return 'dbg'
+ return l
+
parser = OptionParser()
parser.set_defaults(nodegroup="Alpha",
node=None,
parser = OptionParser()
parser.set_defaults(nodegroup="Alpha",
node=None,
@@
-58,7
+67,11
@@
if config.list:
i = 0
for node in nodelist:
print "%-2d" % i,
i = 0
for node in nodelist:
print "%-2d" % i,
- print "%(hostname)-38s %(boot_state)5s %(key)s" % node
+ if node['hostname'] in fb['nodes']:
+ node['current'] = get_current_state(fb['nodes'][node['hostname']]['values'])
+ else:
+ node['current'] = 'none'
+ print "%(hostname)-38s %(boot_state)5s %(current)5s %(key)s" % node
i += 1
elif config.add:
i += 1
elif config.add: