Notifications Question... (Nagios Newbie)


I have a number of service checks that are performed across a wide variety of servers. When a service notification is required, I’d like that notification to go the individual responsible for that particular host/hostgroup. Is there a way to achieve this short of duplicating each service check, such that I have an identical one for each host group? I was hoping that a notification went to the intersection of the host contactgroup and the service contactgroup, but it appears to simply go to the service contact group. Hopefully I misread/misunderstood the docs and this is possible.

Along similar lines, is there anyway to do negation in hostgroup lists (or any plans for it)? It seems to me that it would be advantageous to be able to apply a check to all members of a group (or set of groups) “except for server x”. Something like:

define service…

hostgroup_name webservers, ftpservers
host_name ~thisbox,~thatbox


I haven’t looked at the v2 documentation, but according to v1, both the contact_groups defined in hosts.cfg and in services.cfg will receive notifications as well.

For example: If you have a webservers host group set up with webmasters as a contact group for it. Then define a service check with sysadmins as the contract group. When that service difinition causes a notification, both sysadmins and webmasters should receive it.

Nagios is smart enough to remove duplicate names from the notification list, so a user in both the sysadmins and webmasters groups will only receive one notification, rather than two.


Forgot to mention that there are also filters that are checked against before a notification is actually sent. Things like scheduled downtime, the notification_period setting on the host definiitions. The documetnation describes this in better detail than I can in this forum. Check docs/notifications.html for the skinny.

Also, 1.x doesn’t have hostgroup negation. Not sure on 2.x, haven’t had a chance to look yet.


But herein lies my problem; my network crosses organizational groups, each rather independent. So, if I have an apache failure on a system in personnel, I don’t want to notify webmasters in the sales division. And I don’t see a way to do it without defining multiple http checks for the different origanizational contact groups.

Unless there is a way to do it with macros that is not documented. If I could do something like setting the service notification email destination to $HOST->$CONTACTGROUP that might work. But I didn’t see that feature when I skimmed the macro information.

Ah well, still a great system, I guess I’m just going to have to live with defining hundreds of services (three cheers for inheritance). Is there much of a performance hit from having a huge number of services defined?


use templates, as they work for hosts they SHOULD work for services (haven’t tried them)
Define the service check template and then redefine only the contact groups for the different machines.

I don’t think it changes much if you define one service for 100 hosts or 100 services each for 1 host.



luca is correct. I have over 1000 service checks running every 5 mintues. templates are key, since it saves alot of typing. Define a service template named “ftp check” and now use that template for every host that is running ftp.

Host/service notifications appear to not need what you suggest.

If I have a server located in purchasing, and check it for 10 different services + 1 host check, then each service should have a contact group defined for it. I don’t want contact group “routers” to be notified for “ftp” problems, so just define that service check to notify “ftp guru’s”. Who is going to be notified if the box dies? Define them for the host check.