Best Practices for Contacts


I have Nagios 3.03 running on Solaris 10 with pnp4Nagios.
Currently monitoring 128 hosts with 265 Services.
Nagios is working great…

Notifications and Contacts are very new to me since I have only
used Nagios to notify SA’s in the past…

Recently, others in the organization
have found out about it and want me to add them to certain hosts etc…

3 groups needing notifications
[blockquote]SA - me
Devs -
DBA -[/blockquote]

I want the DEVS and DBA to receive notifications during work hours for specific
I know about timeperiods and those are configured…
I have also created new contacts and contactgroups for them

What would be the most efficient way to do this… ?




I’d say, the best practice would be to create 3 contact groups (SA, Devs and DBA).
The contact groups Devs and DBA would have the option “notification_period” set to the timeperiod you created (ie: work hours).

For each contact group, you’ll have only one contact, which would be the e-mail address of these contacts.

And then, to finish, for each host/service you want the notification sent to them, you add the contact group:

contact_groups SA, Devs, DBA.

Don’t know if it’s clear enough, but anyway, it should be quite easy
=> … ml#contact


You can also use a nested contact group approach…

define contactgroup{ contactgroup_name everyone alias The world and his dog contactgroup_members SA, Devs, DBA }
and use contact_groups everyone in your appropriate host/service checks. … ntactgroup


Thx for the replies…


From my reading any settings in a service file
contact_groups testing

supersede what is listed in templates.cfg
i.e. generic-service

I must be doing something wrong here:


define contact{
        contact_name                    ctran
        use                             generic-contact
        alias                           CT
        contact_groups                  test
        service_notification_period     workhours
        host_notification_period        workhours
        service_notification_options    w,u,c,r
        host_notification_options       d,u,r
        email                           address-here

define contactgroup{
        contactgroup_name       test
        alias                   test
        notification_period     workhours
        members                 ctran

Here is the test.cfg that I am doing my testing with

define host{
        use                     local-server   
        host_name               aml000t1
        alias                   aml000t1
define hostgroup{
        hostgroup_name  Host-Email-Test
        alias           Host-Email-Test
        members         aml000t1
define service{
       use                             local-service
       host_name                       aml000t1
       service_description             PING
        contact_groups                  test
        check_command                   check_ping!100.0,20%!500.0,60%

I am not getting any notification to the email address but I am still getting to the
admin account…

So the changes aren’t taking effect (yes I have stopped and restarted Nagios) :frowning:

Ideas ??



I’m really not sure (I haven’t experimented much with contact-groups, as I really don’t like them :)), but could try to add the “contact_groups test” directive in your host definition ?

not sure it will work better, but it’s worth a try :slight_smile:

ps: thanks for the “So the changes aren’t taking effect (yes I have stopped and restarted Nagios)”; it saves useless questions ^^