3 from monitor.database import FindbadNodeRecord, FindbadPCURecord
5 from nodequery import *
6 from monitor import util
10 dc7800list = util.file.getListFromFile("dc7800.txt")
13 # if membership satisfied
15 # verify pcu constraint
16 # verify node constraint
18 fbquery = FindbadNodeRecord.get_all_latest()
19 for noderec in fbquery:
20 fbinfo = noderec.to_dict()
21 member = verifyType(dc7800['membership'], fbinfo)
22 if not member: continue
25 fbpcuinfo = FindbadPCURecord.get_latest_by(plc_pcuid=fbinfo['plc_node_stats']['pcu_ids'][0]).to_dict()
28 fbinfo['pcuinfo'] = fbpcuinfo
30 pcuok = verifyType(dc7800['pcu']['constraint'], fbpcuinfo)
31 nodeok = verifyType(dc7800['node']['constraint'], fbinfo)
32 print "pcuok : ", pcuok, " nodeok: ", nodeok , " ", hostname
36 if not pcuok and not nodeok:
39 elif not pcuok and nodeok:
42 elif pcuok and not nodeok:
45 elif pcuok and nodeok:
57 print " for %-45s" % hostname