mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 02:33:18 +00:00
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
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue