check_home_assistant: make failures crit
This commit is contained in:
parent
87e332974a
commit
f4bdf2c982
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue