from monitor import util
from monitor.util import command
from monitor import config
-from monitor.database import FindbadNodeRecordSync, FindbadNodeRecord
+
+from monitor.database.info.model import FindbadNodeRecordSync, FindbadNodeRecord, session
+
from monitor.sources import comon
from monitor.wrapper import plc, plccache
observed_category = values['category'],
)
fbnodesync.round = global_round
+ fbnodesync.flush()
+ fbsync.flush()
+ fbrec.flush()
count += 1
print "%d %s %s" % (count, nodename, values)
# CREATE all the work requests
for nodename in l_nodes:
fbnodesync = FindbadNodeRecordSync.findby_or_create(hostname=nodename, if_new_set={'round':0})
-
node_round = fbnodesync.round
+ fbnodesync.flush()
+
if node_round < global_round:
# recreate node stats when refreshed
#print "%s" % nodename
print FindbadNodeRecordSync.query.count()
print FindbadNodeRecord.query.count()
+ session.flush()
def main():
global global_round
global_round += 1
fbsync.round = global_round
+ fbsync.flush()
+
cotop = comon.Comon()
# lastcotop measures whether cotop is actually running. this is a better
# metric than sshstatus, or other values from CoMon
cotop_url = COMON_COTOPURL
# history information for all nodes
- #cohash = {}
- cohash = cotop.coget(cotop_url)
+ cohash = {}
+ #cohash = cotop.coget(cotop_url)
l_nodes = plccache.l_nodes
if config.nodelist:
f_nodes = util.file.getListFromFile(config.nodelist)