From 1fc177ce9a78f28d18ad2e08ff4545a241aa0976 Mon Sep 17 00:00:00 2001 From: Hannes Erven Date: Sun, 8 Dec 2019 23:30:55 +0100 Subject: [PATCH] multi_tcp_ping: enable service_check by default By default, Net::Ping will report a good attempt even when the remote end returns "connection refused". By enabling service_check, the connection must have been established. See https://perldoc.perl.org/Net/Ping.html#Functions --- plugins/ping/multi_tcp_ping | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/ping/multi_tcp_ping b/plugins/ping/multi_tcp_ping index cd07de4e..ee88033d 100755 --- a/plugins/ping/multi_tcp_ping +++ b/plugins/ping/multi_tcp_ping @@ -105,6 +105,7 @@ sub ping_host { $p=Net::Ping->new("tcp", $defaults{timeout}); $p->hires(); + $p->service_check(1); $p->{port_num} = $host->[1] || $defaults{port}; ($ret, $time, $ip) = $p->ping($host->[0]);