check_home_assistant: make failures crit

This commit is contained in:
Cyberes 2024-09-03 20:36:28 -06:00
parent 87e332974a
commit f4bdf2c982
1 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ try:
except: except:
print('Unknown: failed to fetch data') print('Unknown: failed to fetch data')
traceback.print_exc() traceback.print_exc()
sys.exit(nagios.STATE_UNKNOWN) sys.exit(nagios.STATE_CRIT)
if res.status_code == 200: if res.status_code == 200:
if state == 'API running.': if state == 'API running.':
@ -34,4 +34,4 @@ if res.status_code == 200:
sys.exit(nagios.STATE_CRIT) sys.exit(nagios.STATE_CRIT)
else: else:
print(f'Unknown: Request returned status code {str(res.status_code)}') print(f'Unknown: Request returned status code {str(res.status_code)}')
sys.exit(nagios.STATE_UNKNOWN) sys.exit(nagios.STATE_CRIT)