Issues with pinging multiple IPv4 Addresses

I believe I’ve found the cause of this issue.

Check_mk is building the service check command with variables like $HOST_ADDRESSES_4$, $HOST_ADDRESS_4$, etc.

It’s doing this by adding custom object variables to the Nagios host object.

If you run cmk --debug -vvN Internet, where "Internet is the hostname of your “internet host”, you might get output similar to the following:

# ----------------------------------------------------
# Internet
# ----------------------------------------------------
define host {
  _ADDRESSES_4                  8.8.8.8
  _ADDRESS_4                    1.1.1.1
  _ADDRESS_4_1                  8.8.8.8
...

And in the service configuration, you would have seen:

# Active checks
define service {
  active_checks_enabled         1
  check_command                 check_mk_active-icmp!-m 1 -w 200.00,80% -c 500.00,100% $HOST_ADDRESSES_4$ $HOST_ADDRESS_4$

The issue is that, Nagios is expecting the custom variables to look like $_HOSTADDRESS_4$. See Nagios custom object variable docs for more information.

Now, how can you solve this for yourself until check_mk devs get around to it? It’s pretty easy. Check_mk decides which variables to add to the service check command in checks/check_icmp.

I found this file on my system at /opt/omd/1.6.0p7.cre/share/check_mk/checks/check_icmp

All you have to do is replace all instances of HOST_ with _HOST. Turning $HOST_ADDRESS_4$ into $_HOSTADDRESS_4$, for example.

You might need to reconfigure the hosts so the Nagios configuration is rebuilt.


As an aside, this seems to break graphing this service. Everything else appears to work as expected.

3 Likes