Problems with Ping all addresses

Hello @marass,

i just tried to recreate the issue on my site and got the same result as you.

The problem seems to be with the commandline that is being built when you configure the check to use multiple ip-addresses. The commandline is built with $HOST_ADDRESS_4, which should be resolved to the configured IP-address. This variable (or macro, as it is caled in the nagios world) however does not exist. The correct one, as i see it, would be _HOSTADDRESS_4.

If you need a quick fix and don’t mind using the commandline, you can try the following:
It is basically the same @mjorgensen described in the other forum-post related to this problem: Issues with pinging multiple IPv4 Addresses - #9 by mjorgensen
I tweaked his solution a little bit so you don’t have to mess around in the /opt/omd/version/-directory and we make use of the local-hierarchy.

  1. Copy the check_icmp-check to the local-hierarchy:
# as the site-user
cp share/check_mk/checks/check_icmp local/share/check_mk/checks/
  1. Then, with an editor of you choice, edit line 42, so it looks like this:
......
41     elif target == "all_ipv4addresses":
42         args += ["$_HOSTADDRESSES_4$", "$_HOSTADDRESS_4$"]
......

After that, execute cmk -R and the check should work after that.
There are a couple more occurences in this file where this is an issue, e.g. with the macros regarding IPv6-addresses, so the gist would be, everywhere where you see $HOST_ you could replace it with $_HOST

As @mjorgensen also said in his post, this unfortunately breaks the graphs for this check. I don’t have a quick solution for that right now as this seems to be a problem with the performance-data that is returned in a different format when multiple addresses are being processed by the check.

Hope that helps!

Cheers,
Lorenz