icinga2-checks/checker/nagios.py

18 lines
384 B
Python
Raw Normal View History

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
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'