checkmk icon indicating copy to clipboard operation
checkmk copied to clipboard

Prevent duplicate dual-stack PING service (CRE)

Open jplitza opened this issue 1 year ago • 4 comments

General information

Consider having a dual-stacked host with IPv4 preferred. CRE automatically creates an "PING IPv6" service for this host.

Bug reports

Previously, the "PING IPv6" service was written to the Nagios config unconditionally, even when you already had a service by that name for that host (presumably manually configured).

Proposed changes

With this patch, the automatic check is only written to the config file if there is no other check with that description already. This also enables the user to tune the parameters of the service (by creating an active PING check of the same name).

jplitza avatar Aug 23 '22 08:08 jplitza

Is your problem that the auto generated IPv6 PING service does not work for you?

I do not think this is the right solution. Conditionally replacing/creating services is a to much magic behavior. This will make it harder to know which service was created manually and which service is created by check mk. Another issue might is that deleting the rule for the manual "PING IPv6" service would not remove the service, as would happen with other active checks, but rather replace it with another service also called "PING IPv6".

I know that the generated "PING IPvX" services cannot currently be ignored. But I would prefer to allow a configuration option that explicitly ignores services created by checkmk, instead of conditionally creating the services.

kain88-de avatar Aug 24 '22 07:08 kain88-de

Is your problem that the auto generated IPv6 PING service does not work for you?

Exactly. We have dual-stacked hosts that are to be considered "always up" (there's even a section in the docs about this scenario), but they still get the "PING IPv6" service that is then critical when they are down (while everything else is OK).

I do not think this is the right solution. Conditionally replacing/creating services is a to much magic behavior. This will make it harder to know which service was created manually and which service is created by check mk. Another issue might is that deleting the rule for the manual "PING IPv6" service would not remove the service, as would happen with other active checks, but rather replace it with another service also called "PING IPv6".

With this reasoning, the magic "PING IPvX" check should be removed completely! (Which would be OK for me, I can configure them manually.)

I know that the generated "PING IPvX" services cannot currently be ignored. But I would prefer to allow a configuration option that explicitly ignores services created by checkmk, instead of conditionally creating the services.

See above: Why create magic services at all?

jplitza avatar Aug 24 '22 08:08 jplitza

In case a host is configured as "dual-stack", cmk wants to ensure it can be reached on all available IPs. However, the host check command only checks one IP. Therefore, an additional PING Service is created to check the other IP.

Of course, it is not great if the service created by cmk does not have the correct parameters.

Instead of adding more magic behavior, I think it would be better to add an option that disables the automatic creation the additional PING services. I have to check how that would be implemented.

kain88-de avatar Aug 24 '22 12:08 kain88-de

I do understand the reasoning. Basically, the question is whether the users/administrators of CMK have to configure rules for special treatment of dual-stacked hosts (as they have to do with HTTP and every other active check) or CMK magically takes care of this (as it now does with the PING service).

Personally, I'm happy with having a switch to disable the magic behavior, too.

jplitza avatar Aug 25 '22 07:08 jplitza