2 #! -*- coding: utf-8 -*-
4 KEY_FILE = "/root/nrpe-scripts/admins.pkey"
5 CERT_FILE = "/root/nrpe-scripts/admins.cert"
7 ENTRY='http://www.planet-lab.eu:12347'
9 'ppk': 'http://www.planet-lab.kr:12346',
10 'elc': 'http://www.emanicslab.org:12346',
11 'ple': 'http://www.planet-lab.eu:12346',
12 'plc': 'http://www.planet-lab.org:12347',
13 'plj': 'http://www.planet-lab.jp:12346'
17 import sfa.util.xmlrpcprotocol as xmlrpcprotocol
19 class TimeOutException(Exception):
24 def timeout(signum, frame):
25 raise TimeOutException, "Command ran for too long"
28 signal.signal(signal.SIGALRM, timeout)
30 server=xmlrpcprotocol.get_server(url, KEY_FILE, CERT_FILE)
32 version = server.GetVersion()
33 except Exception, why:
43 version = get_version(url)
44 except Exception, why:
45 print "\t[ERROR] (%s): %s" % (url, str(why)),
49 iface = version['interface']
52 print "\t[ OK ] %s (%s)" % (url,iface),
55 for hrn, url in ALL.items():
60 version = get_version(ENTRY)
61 except Exception, why:
62 print "EXCEPTION ", why
64 for hrn, url in version['peers'].items():
68 if __name__ == '__main__':