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 $
15 api = plc.getAuthAPI()
17 from clean_policy import *
20 print "CALLING: mailmonitor.reboot(%s)" % hostname
22 l_nodes = api.GetNodes(hostname)
24 raise Exception("No such host: %s" % hostname)
26 l_blacklist = database.if_cached_else(1, "l_blacklist", lambda : [])
27 l_ticket_blacklist = database.if_cached_else(1,"l_ticket_blacklist",lambda : [])
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__':