This commit is contained in:
Cyberes 2023-04-21 23:54:18 -06:00
parent 4b3fe71057
commit 5549f2fd23
2 changed files with 4 additions and 4 deletions

View File

@ -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)}')

View File

@ -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