Page 1 of 1

Assigning notifications at the host level

Posted: Thu Dec 04, 2014 1:20 pm
by mhschoen
I'm trying to assign notifications at the host level for a group of services, and have not been able to find a configuration that will do what I want.
We have multiple hosts in two continents, each of which run the the same application and group of services.
What I would like to be able to do is assign each set of hosts to one of two contact groups, and have all host and service alerts go to the apporpriate group for that continent.
At the moment, the only way I have been able to get this working is to duplicate the 10 individial services, ie cpu_canada, cpu_australia, in respective service groups svc_canada, svc_australia, and then assign service groups to the host.
Is there a configuration that will let me define the services once, and then send alerts to one host group or another, depending on where the host is located?

Re: Assigning notifications at the host level

Posted: Thu Dec 04, 2014 6:00 pm
by tmcdonald
If you have two hosts, let's call them CAN and AUS, and you have the same services that need different contacts depending on the host, then you can assign the services to both hosts (no need to copy them, and you can even put them in a service group and just assign the group to each host). Then make sure to leave out any contact options in the services, and only assign contact options to the hosts themselves. The services will then inherit the contact options from each host.

http://nagios.sourceforge.net/docs/3_0/ ... tance.html

Re: Assigning notifications at the host level

Posted: Fri Dec 05, 2014 11:47 am
by mhschoen
:oops: Thanks!
As soon as I read that, I realized that my "generic-service" template had "contact_groups admins" defined, which was overriding the host contact_groups.

There is now a head-shaped dent in my desk, and I have a much simpler service configuration file.

Re: Assigning notifications at the host level

Posted: Fri Dec 05, 2014 11:56 am
by tmcdonald
On the bright side you can use the head-shaped dent for soup. So there's that.

Are we free to lock this up?