From 5549f2fd23e6c1e2f0e791293897439e0250f078 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Fri, 21 Apr 2023 23:54:18 -0600 Subject: [PATCH] perfdata --- check_bandwidth.py | 6 +++--- install.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/check_bandwidth.py b/check_bandwidth.py index bf8ce33..778f460 100755 --- a/check_bandwidth.py +++ b/check_bandwidth.py @@ -13,8 +13,8 @@ parser.add_argument('--warn', type=int, default=50, help='Warning if percent of args = parser.parse_args() data = [] -warn_value = (args.bandwidth * args.warn) -crit_value = (args.bandwidth * args.critical) +warn_value = (args.bandwidth * args.warn / 100) +crit_value = (args.bandwidth * args.critical / 100) # Get network interface statistics net_io_counters = psutil.net_io_counters(pernic=True) @@ -53,7 +53,7 @@ for i in range(len(data)): else: ok.append(interface) data[i][2] = 'ok' - perf_data.append(f'{interface}={round(bandwidth_utilization, 2)}B;{warn_value};{crit_value}; ') + perf_data.append(f'{interface}={round(bandwidth_utilization, 2)}MB;{warn_value};{crit_value}; ') if len(ok): print(f'OK: {", ".join(ok)}') diff --git a/install.sh b/install.sh index 33f2577..4e7ad44 100755 --- a/install.sh +++ b/install.sh @@ -6,7 +6,7 @@ apt update apt install -y python3-venv git sysstat -cd /opt || exit +#cd /opt || exit git -C /opt/icinga2-checks pull || git clone https://git.dp15.us/dpanzer/icinga2-checks.git /opt/icinga2-checks