From 7768d53ad06c05da5f29a3849edcb471998a011a Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Tue, 26 Mar 2024 11:46:58 +0100 Subject: [PATCH] Linux ping may print errors, adapt regex. --- netlink.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlink.pl b/netlink.pl index 5450a2f..f3c969f 100755 --- a/netlink.pl +++ b/netlink.pl @@ -787,7 +787,7 @@ sub netbench_parser { sub pingflood_parser { my ($line, $log) = @_; my ($min, $avg, $max, $stddev); - if ($line =~ m{^(\d+) packets transmitted, (\d+) received, ([\.\d]+)% packet loss, time ([\.\d]+)ms$}) { + if ($line =~ m{^(\d+) packets transmitted, (\d+) received,.* ([\.\d]+)% packet loss, time ([\.\d]+)ms$}) { $pingflood_loss = 0 + $3; print $tr "SUBVALUE $1 packet transmit\n"; print $tr "SUBVALUE $2 packet receive\n";