1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 10:39:53 +00:00

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
This commit is contained in:
Hannes Erven 2019-12-08 23:30:55 +01:00 committed by Lars Kruse
parent 1357b8189e
commit 1fc177ce9a

View file

@ -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]);