Update check_ping.py
This commit is contained in:
@ -72,15 +72,16 @@ def main():
|
||||
|
||||
while True:
|
||||
output = run_ping(args.host, args.packets, args.timeout, args.ipv4, args.ipv6, args.interface)
|
||||
|
||||
rta, loss = parse_ping_output(output)
|
||||
|
||||
if rta is None or loss is None:
|
||||
print("PING UNKNOWN - Parsing error")
|
||||
sys.exit(3)
|
||||
|
||||
status = check_thresholds(rta, loss, args.w, args.c)
|
||||
status = check_thresholds(rta, loss, args.warning, args.critical)
|
||||
|
||||
perf = f"| rta={rta}ms;{args.w.split(',')[0]};{args.c.split(',')[0]} loss={loss}%;{args.w.split(',')[1].strip('%')};{args.c.split(',')[1].strip('%')}"
|
||||
perf = f"| rta={rta}ms;{args.warning.split(',')[0]};{args.critical.split(',')[0]} loss={loss}%;{args.warning.split(',')[1].strip('%')};{args.critical.split(',')[1].strip('%')}"
|
||||
|
||||
if status == 0:
|
||||
fail_count = 0
|
||||
|
Reference in New Issue
Block a user