I recently set up a few passive checks using NSCA. No problems there -- I'm not doing anything high-concept, so the myriad tutorials for how to set it up were entirely sufficient. That said, the passive service checks are, right now, configured to only go to me, since I wanted to give them a bit of a shakedown before setting them up to (say) wake people up in the middle of the night.
However, last night, a notification for one of these passive services went out to the contactgroup for the host that the service is on. I've spent a little time looking over the inheritance procedure in Nagios objects, and I don't get the impression that services should be automatically inheriting attributes from the host. From things like the generic-service template (or, as the case may be, the passive-service template, which itself uses generic-service), certainly, but not the host. And, double-checking the logs, it was the service which had an issue -- this wasn't a host-down situation at all.
I'm clearly misunderstanding something, so I come to this august body. Should a service on a host be inheriting anything from the host attributes? And if so, is there a way to disable any part of the inheritance? In general, I only want contacts or contactgroups specifically enumerated in the service check to be notified. Or is this an indication that I've got a configuration item somewhere that I shouldn't?
Host contacts referenced for services on that host?
-
thudthwacker
- Posts: 5
- Joined: Wed Sep 30, 2015 8:42 am
Re: Host contacts referenced for services on that host?
Yes, this is part of the implied inheritance. See this page - https://assets.nagios.com/downloads/nag ... tance.html
The key part is this -
Depending how you have it setup currently, you'll need to change things around. Assigning a contact specifically to that service will also break the implied inheritance. (just tested after I was curious)
Code: Select all
contact_groups contact_groups in the associated host definition
Code: Select all
The following table lists the object variables that will be implicitly inherited from related objects if you don't explicitly specify their value in your object definition or inherit them from a template.
Former Nagios Employee
-
thudthwacker
- Posts: 5
- Joined: Wed Sep 30, 2015 8:42 am
Re: Host contacts referenced for services on that host?
That's odd; I do have a contact assigned to the service explicitly. So, that overrode the contact_group of the host when you set it on the service? That doesn't look to be happening for me. Though it sounds like I can set a contact_group of null in the service check to explicitly override the host contact_group, which should be fine for short-term. (Eventually, the service contact_group will be the same as the host contact_group; it's just for testing purposes that I didn't want alerts going out to everyone.)
(Also: many thanks for pointing me at the document I was evidently unable to find on my own. Actually, I think I did read part of that page, but never noticed the helpful table toward the bottom for implied cross-object-type inheritance. Well, I feel sheepish.)
(Also: many thanks for pointing me at the document I was evidently unable to find on my own. Actually, I think I did read part of that page, but never noticed the helpful table toward the bottom for implied cross-object-type inheritance. Well, I feel sheepish.)
Re: Host contacts referenced for services on that host?
Odd that you're seeing something different. I tested it as I wrote my post as I wasn't sure if the implied inheritance would 'null out' by using a contact and not a contact group.
Could you post the relative definitions from your /usr/local/nagios/var/objects.cache file for us to look at? The host / service definitions for this one in specific should do. There could be a template in play somewhere so looking at the objects.cache file will help us out the most here as it's how the configurations are compiled at the end of the day that matters.
Could you post the relative definitions from your /usr/local/nagios/var/objects.cache file for us to look at? The host / service definitions for this one in specific should do. There could be a template in play somewhere so looking at the objects.cache file will help us out the most here as it's how the configurations are compiled at the end of the day that matters.
Former Nagios Employee