Implied object inheritance and the web interface

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
gcarbone
Posts: 2
Joined: Mon Jan 15, 2018 5:06 am

Implied object inheritance and the web interface

Post by gcarbone »

Hello, I need some help with the contacts/contact_groups implied object inheritance and the web interface.

I'm running Nagios Core 4.4.3.

I have many hosts and their related services, every host has a contact_groups property declared (and not contacts one), almost every related service doesn't have its of contacts/contact_groups because I'm ok with inheriting them from the host.

There are though some specific services that define their own contacts and contact_groups because I need a different behaviour.
Specifically I need that these service are notified and displayed on the web interface to different users than all the other host's services.

The problem I'm facing is that, while the notification part works properly, on the web interface I get mixed results.

Using the example snippet i posted below this is what I'm getting:
- Contact "all_notifications" gets notifications for all services "check 1", "check 2" and "check 3" and also sees them on the web interface as expected.
- Contact "check3_notifications" gets notifications for service "check 3" and sees only "check3" on the web interface as expected.
- Contact "web_user" gets notifications for services "check 1" and "check 2" but sees all of them on the web interface and that's where I'm failing to understand what's going on.

Am I doing something wrong? Is this the expected behaviour? Shouldn't "web_user" see the same services it gets notifications for?

I'm pointing at the implied object inheritance because it seems to me that the web interface do not take properly account of the contacts/contact_groups override on the service object and instead does an implicit additive inheritance with the ones from the host and the ones from the service (implicit means I didn't put any "+" sign anywhere).

The main and only reason for this, in case you're wondering, is that those specific services, like "check 3" here, are intended for other people than all other services (e.g.: "check 1" and "check 2") and those who see others don't want to have their web interface "cluttered" with unwanted services.

This is of course a semplified configuration snippet, I think (hope) I kept all the relevant parts.

Code: Select all

define host {
        host_name		host1
        address			host1.mydomain.loc
        contact_groups		cg-host-monitoring
	...
}

define service {
        host_name		host1
        service_description	check 1
	...
}

define service {
        host_name		host1
        service_description	check 2
	...
}

define service {
        host_name		host1
        service_description	check 3
        contacts		check3_notifications
        contact_groups		cg-check3
	...
}

define contactgroup {
	contactgroup_name	cg-host-monitoring
	members			all_notifications,web_user
}	

define contactgroup {
	contactgroup_name	cg-check3
	members			all_notifications
}

define contact {
        contact_name            all_notifications
	...
}

define contact {
        contact_name            web_user
	...
}

define contact {
        contact_name            check3_notifications
	...
}
ErickSpofe
Posts: 1
Joined: Fri Aug 14, 2020 12:58 pm
Location: Украина
Contact:

Implied object inheritance and the web interface

Post by ErickSpofe »

thank you...i used to change the template code but now i am on freshstoreinstant and dont have access....getting rid of the button on the category page will be a big improvement. I really appreciate the help
gcarbone
Posts: 2
Joined: Mon Jan 15, 2018 5:06 am

Re: Implied object inheritance and the web interface

Post by gcarbone »

I'm sorry but I don't get what you mean with your reply, I'm not even sure it was meant as a reply to my post to be honest.
Locked