Plugin multi_tcp_ping: gracefully handle DNS resolution problems
Previously the plugin exited with an error, if the target name could not be resolved. Now this problem is handled just like an "unreachable" situation. Thanks, nitram2342! Closes: #1091
This commit is contained in:
parent
9e2b918229
commit
8cff506f07
|
@ -108,7 +108,9 @@ sub ping_host {
|
|||
$p->service_check(1);
|
||||
$p->{port_num} = $host->[1] || $defaults{port};
|
||||
|
||||
($ret, $time, $ip) = $p->ping($host->[0]);
|
||||
eval {
|
||||
($ret, $time, $ip) = $p->ping($host->[0]);
|
||||
};
|
||||
|
||||
$time = $defaults{unreachable} if !$ret;
|
||||
print "${addr}.value $time\n";
|
||||
|
|
Loading…
Reference in New Issue