17 lines
383 B
Python
17 lines
383 B
Python
# TODO: remove non STATE_ vars
|
|
UNKNOWN = STATE_UNKNOWN = -1
|
|
OK = STATE_OK = 0
|
|
WARNING = STATE_WARN = 1
|
|
CRITICAL = STATE_CRIT = 2
|
|
|
|
|
|
def state_to_txt(state: int) -> str:
|
|
if state == STATE_UNKNOWN:
|
|
return 'UNKNOWN'
|
|
elif state == STATE_OK:
|
|
return 'OK'
|
|
elif state == STATE_CRIT:
|
|
return 'CRITICAL'
|
|
elif state == STATE_WARN:
|
|
return 'WARNING'
|