[Nagiosplug-help] Notification sent to two different recipients?

Jason Lee leejm_ca at yahoo.com
Sat Oct 17 01:57:43 CEST 2009


Hi everyone,


I'd like to enable Nagios host and service alert notifications to be sent to different e-mail recipients.  Meaning, when a nagios monitored host/service goes down, it sends an e-mail to one recipient.  When a host/service goes into a recovery state, an e-mail is sent to a different e-mail recipient.

I have added two different groups in my contacts.cfg file.


define contact{
        contact_name                    nagiosadmin             ; Short name of user
        use                             generic-contact         ; Inherit default values from generic-contact in template.cfg
        alias                           Nagios Admin            ; Full name of user
        email                           nagiosadmin             ; Email nagiosadmin
        host_notification_options       d                       ; Notify Nagios admin when host goes down
        service_notification_options    c,w                     ; Notify Nagios admin when service becomes critical or warning
        }

define contact{
        contact_name              nagiosrecover           ; Short name of user
        use                             generic-contact         ; Inherit default values from generic-contact in template.cfg
        alias                           nagiosrecover           ; Full name of user
        email                          nagiosrecover           ; Email nagiosrecover
        host_notification_options       r                       ;Email nagiosrecover when host recovers
        service_notification_options    r                       ; Email nagiosrecover when service recovers
        }

 
When run /root/nagios to check my configuration I receive the errors:

Warning: Host recovery notification option for contact 'nagiosrecover' doesn't make any sense - specify down and/or unreachable options as well
Warning: Service recovery notification option for contact 'nagiosrecover' doesn't make any sense - specify critical and/or warning options as well

If I specify host_notification_options "d,u,r,f,s" I have no problems.   But that defeats the purpose of notify two different e-mail distribution lists.

Does anyone have any suggestions on how to resolve this?    Should I use a different cfg file other than the contacts.cfg file.


Thanks in advance,

Jason




More information about the Help mailing list