7 from monitor.wrapper import plc
9 def argv_to_dict(argv):
11 NOTE: very bare-bones, no error checking, will fail easily.
25 d = argv_to_dict(sys.argv[1:])
28 if 'hostname' in d or 'H' in d:
34 print "UNKNOWN: argument error"
38 n = api.GetNodes(hostname)[0]
40 print "UNKNOWN: API failure"
47 print "FAKE-OK: PCU test successful"
50 print "FAKE-WARNING: PCU configuration incomplete"
53 print "FAKE-CRITICAL: PCU test failed"
57 if __name__ == '__main__':
58 f = open("/tmp/checkpcu", 'a')
59 f.write("checkpcu %s %s\n" % (time.time(), " ".join(sys.argv[1:])))