check_speedtest: fix levels

This commit is contained in:
Cyberes 2023-04-21 23:54:20 -06:00
parent dfc77a2f4d
commit d3c6d61b6b
1 changed files with 9 additions and 9 deletions

View File

@ -39,20 +39,20 @@ def main():
exit_code = nagios.OK exit_code = nagios.OK
if speedtest_results['90th_percentile_upload_speed']['value'] <= args.warn_up and exit_code < nagios.WARNING: if speedtest_results['90th_percentile_upload_speed']['value'] <= args.critical_up and exit_code < nagios.CRITICAL:
exit_code = nagios.WARNING
elif speedtest_results['90th_percentile_upload_speed']['value'] <= args.critical_up and exit_code < nagios.CRITICAL:
exit_code = nagios.CRITICAL exit_code = nagios.CRITICAL
elif speedtest_results['90th_percentile_upload_speed']['value'] <= args.warn_up and exit_code < nagios.WARNING:
exit_code = nagios.WARNING
if speedtest_results['90th_percentile_download_speed']['value'] <= args.warn_down and exit_code < nagios.WARNING: if speedtest_results['90th_percentile_download_speed']['value'] <= args.critical_down and exit_code < nagios.CRITICAL:
exit_code = nagios.WARNING
elif speedtest_results['90th_percentile_download_speed']['value'] <= args.critical_down and exit_code < nagios.CRITICAL:
exit_code = nagios.CRITICAL exit_code = nagios.CRITICAL
elif speedtest_results['90th_percentile_download_speed']['value'] <= args.warn_down and exit_code < nagios.WARNING:
exit_code = nagios.WARNING
if speedtest_results['latency_ms']['value'] >= args.warn_latency and exit_code < nagios.WARNING: if speedtest_results['latency_ms']['value'] >= args.warn_latency and exit_code < nagios.CRITICAL:
exit_code = nagios.WARNING
elif speedtest_results['latency_ms']['value'] >= args.warn_latency and exit_code < nagios.CRITICAL:
exit_code = nagios.CRITICAL exit_code = nagios.CRITICAL
elif speedtest_results['latency_ms']['value'] >= args.warn_latency and exit_code < nagios.WARNING:
exit_code = nagios.WARNING
if exit_code == nagios.OK: if exit_code == nagios.OK:
status_str = 'OK' status_str = 'OK'