3 from monitor import parser as parsermodule
4 from findbad import main as findbad_main
5 from findbadpcu import main as findbadpcu_main
6 from sitebad import main as sitebad_main
7 from nodebad import main as nodebad_main
8 from pcubad import main as pcubad_main
9 from monitor.wrapper import plccache
10 from monitor.database.info.model import *
11 from monitor.common import *
14 if __name__ == '__main__':
16 parser = parsermodule.getParser(['nodesets'])
18 parser.set_defaults( increment=False, dbname="findbad", cachenodes=False,
19 force=False, pcuselect=None, pcuid=None, pcu=None, checkpcu=False)
20 parser.add_option("", "--cachenodes", action="store_true",
21 help="Cache node lookup from PLC")
22 parser.add_option("", "--dbname", dest="dbname", metavar="FILE",
23 help="Specify the name of the database to which the information is saved")
24 parser.add_option("-i", "--increment", action="store_true", dest="increment",
25 help="Increment round number to force refresh or retry")
26 parser.add_option("", "--force", action="store_true", dest="force",
27 help="Force probe without incrementing global 'round'.")
28 parser.add_option("", "--checkpcu", dest="checkpcu", action="store_true",
29 help="whether to include PCUs in the site status")
31 parser = parsermodule.getParser(['defaults'], parser)
33 cfg = parsermodule.parse_args(parser)
38 print "befor-len: ", len( [ i for i in session] )
39 session.flush(); session.clear()
40 print "after-len: ", len( [ i for i in session] )
43 print "befor-len: ", len( [ i for i in session] )
44 session.flush(); session.clear()
45 print "after-len: ", len( [ i for i in session] )
48 print "befor-len: ", len( [ i for i in session] )
49 session.flush(); session.clear()
50 print "after-len: ", len( [ i for i in session] )
53 print "befor-len: ", len( [ i for i in session] )
54 session.flush(); session.clear()
55 print "after-len: ", len( [ i for i in session] )
58 print "befor-len: ", len( [ i for i in session] )
59 session.flush(); session.clear()
60 print "after-len: ", len( [ i for i in session] )
61 except Exception, err:
64 print traceback.print_exc()
65 print "Exception: %s" % err
66 print "Saving data... exitting."