diff --git a/check_speedtest.py b/check_speedtest.py index c45417d..b6c9a50 100755 --- a/check_speedtest.py +++ b/check_speedtest.py @@ -39,20 +39,20 @@ def main(): exit_code = nagios.OK - if speedtest_results['90th_percentile_upload_speed']['value'] <= args.warn_up and exit_code < nagios.WARNING: - exit_code = nagios.WARNING - elif speedtest_results['90th_percentile_upload_speed']['value'] <= args.critical_up and exit_code < nagios.CRITICAL: + if speedtest_results['90th_percentile_upload_speed']['value'] <= args.critical_up and 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: - exit_code = nagios.WARNING - elif speedtest_results['90th_percentile_download_speed']['value'] <= args.critical_down and exit_code < nagios.CRITICAL: + if speedtest_results['90th_percentile_download_speed']['value'] <= args.critical_down and 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: - exit_code = nagios.WARNING - elif speedtest_results['latency_ms']['value'] >= args.warn_latency and exit_code < nagios.CRITICAL: + if speedtest_results['latency_ms']['value'] >= args.warn_latency and 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: status_str = 'OK'