2023-06-15 11:00:41 -06:00
|
|
|
# TODO: remove non STATE_ vars
|
2023-11-26 23:15:27 -07:00
|
|
|
|
2023-06-15 11:00:41 -06:00
|
|
|
UNKNOWN = STATE_UNKNOWN = -1
|
|
|
|
OK = STATE_OK = 0
|
|
|
|
WARNING = STATE_WARN = 1
|
|
|
|
CRITICAL = STATE_CRIT = 2
|
2023-07-06 09:44:37 -06:00
|
|
|
|
|
|
|
|
|
|
|
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'
|