From 6def1921c04f3675ffa156885d3b10a8766cd16d Mon Sep 17 00:00:00 2001 From: Cyberes Date: Sat, 9 Sep 2023 12:29:12 -0600 Subject: [PATCH] check_opnsense_traffic_for_host: convert levels to int --- check_opnsense_traffic_for_host.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_opnsense_traffic_for_host.py b/check_opnsense_traffic_for_host.py index 815ab79..8555ed4 100755 --- a/check_opnsense_traffic_for_host.py +++ b/check_opnsense_traffic_for_host.py @@ -123,8 +123,8 @@ def main(): print_icinga2_check_status(f'failed to parse traffic data: {e}\n{traceback.format_exc()}\n{traffic_data}', nagios.STATE_UNKNOWN) sys.exit(nagios.UNKNOWN) - warn_b_value = (args.bandwidth * args.bandwidth_warn / 100) * 1e+6 - crit_b_value = (args.bandwidth * args.bandwidth_crit / 100) * 1e+6 + warn_b_value = int((args.bandwidth * args.bandwidth_warn / 100) * 1e+6) + crit_b_value = int((args.bandwidth * args.bandwidth_crit / 100) * 1e+6) conn_warn = args.conn_warn if args.conn_warn > -1 else None conn_crit = args.conn_crit if args.conn_crit > -1 else None