else:
values['ping'] = "PING"
+ #uptime = soltesz.SSH('root', nodename)
+ #(oval,eval) = uptime.run_noexcept("uptime | awk '{print $3,$4}' | tr , ' '")
+
### RUN SSH ######################
b_getbootcd_id = True
ssh = soltesz.SSH('root', nodename)
eval = ""
(oval, eval) = ssh.run_noexcept('echo `uname -a ; ls /tmp/bm.log`')
val = oval
- if "2.6.17" in oval or "2.6.20" in oval:
+ if "2.6.17" in oval or "2.6.2" in oval:
values['ssh'] = 'SSH'
+ values['category'] = 'ALPHA'
if "bm.log" in oval:
- values['category'] = 'ALPHA'
values['state'] = 'DEBUG'
else:
- values['category'] = 'ALPHA'
values['state'] = 'BOOT'
elif "2.6.12" in oval or "2.6.10" in oval:
values['ssh'] = 'SSH'
val = oval
if "BootCD" in val:
values['bootcd'] = val
- if "v2" in val and nodename is not "planetlab1.cs.unc.edu":
+ if "v2" in val and \
+ ( nodename is not "planetlab1.cs.unc.edu" and \
+ nodename is not "planetlab2.cs.unc.edu" ):
values['category'] = 'OLDBOOTCD'
else:
values['bootcd'] = ""
plc_lock.acquire()
try:
- d_node = plc.getNodes({'hostname': nodename}, ['pcu_ids', 'site_id', 'last_contact', 'boot_state'])
+ d_node = plc.getNodes({'hostname': nodename}, ['pcu_ids', 'site_id', 'last_contact', 'boot_state', 'nodegroup_ids'])
except:
+ b_except = True
+ import traceback
b_except = True
import traceback
traceback.print_exc()
values['pcu'] = "NOPCU"
site_id = d_node[0]['site_id']
last_contact = d_node[0]['last_contact']
+ nodegroups = d_node[0]['nodegroup_ids']
values['plcnode'] = {'status' : 'SUCCESS',
'pcu_ids': pcu,
'boot_state' : d_node[0]['boot_state'],
'site_id': site_id,
+ 'nodegroups' : nodegroups,
'last_contact': last_contact}
else:
values['pcu'] = "UNKNOWN"
else:
values['plcsite'] = {'status' : "GS_FAILED"}
+ values['checked'] = time.time()
+
return (nodename, values)
def recordPingAndSSH(request, result):
# history information for all nodes
cohash = cotop.coget(cotop_url)
-
- if config.filename == "":
- l_nodes = syncplcdb.create_plcdb()
- l_nodes = [node['hostname'] for node in l_nodes]
+ l_nodes = syncplcdb.create_plcdb()
+ l_nodes = [node['hostname'] for node in l_nodes]
#l_nodes = cohash.keys()
- else:
- l_nodes = config.getListFromFile(config.filename)
+# else:
+# l_nodes = config.getListFromFile(config.filename)
checkAndRecordState(l_nodes, cohash)