blob: d2720a593126109c5af9fe26bbc3cab1f60e6332 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
system = 'undefined'
def report(code, message):
codes = {0: 'OK', 1: 'WARNING', 2: 'CRITICAL', 3: 'UNKNOWN'}
print "%d %s - %s - %s" % \
(code, system, codes[code], message)
exit(code)
def fail(message):
report(2, message)
def warn(message):
report(1, message)
def ok(message):
report(0, message)
def unknown(message):
report(3, message)
|