fix default values

This commit is contained in:
Cyberes 2023-04-21 23:54:20 -06:00
parent a5b3634238
commit 01b8586a8d
1 changed files with 7 additions and 7 deletions

View File

@ -14,10 +14,10 @@ def main():
https://github.com/tevslin/cloudflarepycli/blob/main/src/cloudflarepycli/__main__.py
"""
parser = argparse.ArgumentParser(description='Check internet speed.')
parser.add_argument('--warn-up', type=int, default=999999, help='Warn level of upload speed in Mbps.')
parser.add_argument('--critical-up', type=int, default=999999, help='Critical level of upload speed in Mbps.')
parser.add_argument('--warn-down', type=int, default=999999, help='Warn level of download speed in Mbps.')
parser.add_argument('--critical-down', type=int, default=999999, help='Critical level of download speed in Mbps.')
parser.add_argument('--warn-up', type=int, default=-1, help='Warn level of upload speed in Mbps.')
parser.add_argument('--critical-up', type=int, default=-1, help='Critical level of upload speed in Mbps.')
parser.add_argument('--warn-down', type=int, default=-1, help='Warn level of download speed in Mbps.')
parser.add_argument('--critical-down', type=int, default=-1, help='Critical level of download speed in Mbps.')
parser.add_argument('--warn-latency', type=int, default=60, help='Warn level of latency in ms.')
parser.add_argument('--critical-latency', type=int, default=100, help='Critical level of latency in ms.')
args = parser.parse_args()
@ -31,17 +31,17 @@ def main():
if speedtest_results['90th_percentile_upload_speed']['value'] <= args.warn_up and exit_code < nagios.WARNING:
exit_code = nagios.WARNING
if speedtest_results['90th_percentile_upload_speed']['value'] <= args.critical_up and exit_code < nagios.CRITICAL:
elif speedtest_results['90th_percentile_upload_speed']['value'] <= args.critical_up and exit_code < nagios.CRITICAL:
exit_code = nagios.CRITICAL
if speedtest_results['90th_percentile_download_speed']['value'] <= args.warn_down and exit_code < nagios.WARNING:
exit_code = nagios.WARNING
if speedtest_results['90th_percentile_download_speed']['value'] <= args.critical_down and exit_code < nagios.CRITICAL:
elif speedtest_results['90th_percentile_download_speed']['value'] <= args.critical_down and exit_code < nagios.CRITICAL:
exit_code = nagios.CRITICAL
if speedtest_results['latency_ms']['value'] <= args.warn_latency and exit_code < nagios.WARNING:
exit_code = nagios.WARNING
if speedtest_results['latency_ms']['value'] <= args.warn_latency and exit_code < nagios.CRITICAL:
elif speedtest_results['latency_ms']['value'] <= args.warn_latency and exit_code < nagios.CRITICAL:
exit_code = nagios.CRITICAL
if exit_code == nagios.OK: