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 *
16 api = plc.getAuthAPI()
19 print "CALLING: mailmonitor.reboot(%s)" % hostname
21 l_nodes = api.GetNodes(hostname)
23 raise Exception("No such host: %s" % hostname)
25 l_blacklist = database.if_cached_else(1, "l_blacklist", lambda : [])
26 l_ticket_blacklist = database.if_cached_else(1,"l_ticket_blacklist",lambda : [])
28 l_nodes = filter(lambda x : not x['hostname'] in l_blacklist, l_nodes)
30 raise Exception("Host removed via blacklist: %s" % hostname)
32 mon = MonitorMergeDiagnoseSendEscellate(hostname, True)
38 for host in sys.argv[1:]:
41 if __name__ == '__main__':