3 # Copyright (c) 2004 The Trustees of Princeton University (Trustees).
5 # Stephen Soltesz <soltesz@cs.princeton.edu>
7 # $Id: monitor.py,v 1.7 2007/07/03 19:59:02 soltesz Exp $
11 from monitor import database
12 from monitor.wrapper import rt
13 from monitor.wrapper import plc
14 from monitor.policy import *
15 from monitor.database.info.model import *
17 api = plc.getAuthAPI()
20 print "CALLING: mailmonitor.reboot(%s)" % hostname
22 l_nodes = api.GetNodes(hostname)
24 raise Exception("No such host: %s" % hostname)
26 q_blacklist = BlacklistRecord.query.all()
28 l_blacklist = [ n.hostname for n in q_blacklist ]
29 l_nodes = filter(lambda x : not x['hostname'] in l_blacklist, l_nodes)
31 raise Exception("Host removed via blacklist: %s" % hostname)
33 mon = MonitorMergeDiagnoseSendEscellate(hostname, True)
39 for host in sys.argv[1:]:
42 if __name__ == '__main__':