Services not inheriting Host's contact groups

Hi all

I am assigning contact groups to hosts using “Assignment of hosts to contact groups” (rule is base on a host tag).

There are not rules in “Assignment of services to contact groups”, so the expectation would be that the services of a host have the same contact group as the host.

When I go to “Monitor > Overview > All hosts > myhost.foo.bar” I can see the correct groups assigned to the host. However, in “Monitor > Overview >All hosts > myhost.foo.bar > Services of host > Service” I can only see the contact group “all” but none of the expected contact groups.

Am I making some kind of incorrect assumption or is there a misconfiguration somewhere?

Thanks!

1 Like

Can you explain what are trying to accomplish with that? Usually contact groups are used for notifications or to control access to Checkmk. If you need more strict access requirements you can change the following option and then explicitely define the service contact groups:

Ah, sorry for the missing context. I discovered this problem because hosts notifications are sent, but service notifications are not (well, they are, but only to members of the contact group “all”). Notification rules are fine. THe setting you mentionned are both set to loose.

Can you share details about your notification rule?

I added a screenshot below. Really simple.

I can also use “Test notifications” to reproduce this issue. The recipients listed in the predicted notification also match the behaviour i see (host contacts missing for service notifications).

1 Like

Do you have any other notification rule in place? If not can you modify the rule to send to a specific email and add your own email manually? after that trigger a service test notification.

Yes, i already tried this and it works fine for both service and host notifications. But then changing it back to “all contacts of the notified object” it stops working again.

I have 4 other rules, but i disabled them all for now.

1 Like

Great, Now try setting a single contact in the notification rule if possible. Instead of explicitely setting the user mail let it read from the user profile that you selected.

I already tried.

Explicit Mail: Works

Explizit User: Works

Explicit Contact Group: Works

“All contacts of the notified object”: Not working

→ I really don’t think this is due to the notifications but some other thing. As in the Service View itself i also do not see any contact group except “all”.

Of course, when i assign a contact group to service (as opposed to a host) it also works. But i would like to inherit contact groups from the host.

1 Like

Perfect, now after triggering the notifications to “All contacts of the notified object” go to Service notifications of that services and validate if the notifications commands are being triggered and what is the output after completion, assuming that is happening.

I checked the Service Notifications Table and it is empty - but i think this is due to them being test notifications. For other service notifications i can see them, but there is of course no entry for the missing host/service contact.

I am sure this is not a notification issue:

When I go to “Monitor > Overview > All hosts > myhost.foo.bar” I can see the correct groups assigned to the host. However, in “Monitor > Overview >All hosts > myhost.foo.bar > Services of host > Service” I can only see the contact group “all” but none of the expected contact groups.

Hi @bellsandwhistles,

I think I can see what is happening here. Your assumption about inheritance is correct in principle, but there is a subtle mechanism that is breaking it in your case.

The root cause: the built-in all contact group

Every service in Checkmk is automatically assigned to the predefined all contact group. The inheritance rule states that a service only inherits contact groups from its host if it has no explicit contact group assignment of its own. Since every service already has all as an explicit assignment, the inheritance from the host never kicks in — which is exactly what you are seeing in the service view.

How to confirm this in 30 seconds

Run this on your Checkmk server as the site user:

cmk -D myhost.foo.bar

You will see something like this:

Host myhost.foo.bar
  Contact groups:   your-contact-group, all    ← correct

Services:
  Service: CPU utilization
    Contact groups:   all                       ← inheritance blocked
  Service: Memory
    Contact groups:   all                       ← same

If the host has your custom contact group but all services only show all, that confirms the diagnosis.

The fix

Add a matching rule for services alongside your existing host rule:

Setup → Services → Service monitoring rules
→ Assignment of services to contact groups
→ New rule with the same host tag conditions as your host rule
→ Assign the same contact group

After saving and activating changes, run cmk -D myhost.foo.bar again — your contact group should now appear under the services as well, and “All contacts of the notified object” in your notification rule will start working correctly for service notifications too.

Why explicit is right here and not implicit

The Checkmk docs note that once you go beyond a simple single-team setup, explicitly assigning contact groups to both hosts and services is the cleaner approach anyway — it makes your configuration transparent and predictable, and avoids surprises when the all group is involved.

Hope that helps!

Greetz Bernd

1 Like

While your explanation seems accurate I don’t think it matches any of the actual behaviour of Checkmk.

I actually just tested this with another instance of Checkmk running on a separate network. Despite the settings surrounding contact group assignments being the same on both instances, the behaviour is different. There, contact groups are inherited correctly to the services.

Here is the proof:

Resulting in:

On the affected instance I also just upgraded from 2.4.0p17 to p22, just to see. The instance where it is working is on 2.3.0p22.

and how it looks on the CLI

cmk -D myhost.foo.bar

This command simply dumps what i also see in:

Monitor > Overview > All hosts > myhost.foo.bar —–> Expected contact groups visible

Monitor > Overview >All hosts > myhost.foo.bar > Services of host > Service —–> Only “all” and explicity assigned groups visible.

sounds perfect … then it should works …

other Idea is to remove the Host from the Site … restart the the site and add again to fix e.g. config files or miss matches

I tried (re)adding hosts in different ways, but always with the same result.

I also restarted the site. I looked through all the raw config files in /etc/checkmk/conf.d to see if there are any corrupt entries to no avail.

puhh … now im off with no additional idea …

Just to confirm: there are no contact groups assignments being made on the folder (or parent folder) of the host or even in the host properties itself?

(This also disables the implicit inheritance that Bernd explained and you already checked.)

1 Like

Thanks guys for your help, finally I found the cause. There was indeed a permission on the Main Folder. I think I saw it before, but assumed it was some sort of default config. I cross-checked on the other instance and did not find it there. I removed it entirely and now the inheritance is working as expected.

3 Likes