#!/usr/bin/python
-import plc
+from monitor.wrapper import plc, plccache
api = plc.getAuthAPI()
import sys
for field in ['cpuspeed', 'memsize', 'disksize']:
if field not in cstat: cstat[field] = "null"
- if cstat['cpuspeed'] != "null" and float(cstat['cpuspeed']) < 2.4:
+ if cstat['cpuspeed'] != "null" and float(cstat['cpuspeed']) < 2.2:
return "BAD" # "cpu_slow",
- if cstat['memsize'] != "null" and float(cstat['memsize']) < 2.9:
+ if cstat['memsize'] != "null" and float(cstat['memsize']) < 2.8:
return "BAD" # "mem_small",
- if cstat['disksize'] != "null" and float(cstat['disksize']) < 320.0:
+ if cstat['disksize'] != "null" and float(cstat['disksize']) < 300.0:
return "BAD" # "disk_small",
if cstat['disksize'] == "null" and \
return "N/A"
try:
- if float(cstat['cpuspeed']) >= 2.4 and \
- float(cstat['memsize']) >= 2.9 and \
- (cstat['disksize'] == "null" or float(cstat['disksize']) >= 320.0):
+ if float(cstat['cpuspeed']) >= 2.2 and \
+ float(cstat['memsize']) >= 2.8 and \
+ (cstat['disksize'] == "null" or float(cstat['disksize']) >= 300.0):
return "A-OK"
except:
print cstat
fbstr = get_filefromglob(d, "production.findbad")
fbpcustr = get_filefromglob(d, "production.findbadpcus")
- l_plcnodes = database.dbLoad("l_plcnodes")
- l_plcsites = database.dbLoad("l_plcsites")
- lb2hn = database.dbLoad("plcdb_lb2hn")
+ l_plcnodes = plccache.l_nodes
+ l_plcsites = plccache.l_sites
+ lb2hn = plccache.plcdb_lb2hn
fb = archive.load(fbstr)
fbpcu = archive.load(fbpcustr)
reboot.fb = fbpcu