Page 1 of 1

Send notifications for a service to other contact than admin

Posted: Wed Jul 09, 2014 9:39 am
by AlbertP
Hello,

I have a number of services for which I want notifications to go to a separate e-mail address instead of the nagiosadmin contact.
In conf.d/generic-services.cfg I have removed "contact_groups admins" from the generic service definition, and under it I made two service definitions for the normal services (aes-service) and the "updates" services for which another contact needs to be mailed.

Code: Select all

define service{
    name            aes-service
    use             service
    contact_groups  admins
    register        0
}
define service{
    name            updates-service
    use             service
    contacts        updates
    register        0
}
This is working, with one problem: the updates services send notifications to both the updates contact, and the admin. Can I prevent e-mails going to the admin for these services?

Re: Send notifications for a service to other contact than a

Posted: Wed Jul 09, 2014 9:40 am
by tmcdonald
Does the "use service" template define the admin as a contact?

Re: Send notifications for a service to other contact than a

Posted: Wed Jul 09, 2014 10:48 am
by AlbertP
No. I removed this contact from the service template when creating the two templates from my first post.

E-mails for normal services (aes-service) go to admin, e-mails for update-service to both.

This is my "service" template:

Code: Select all

define service{
        name                            service      	; The 'name' of this service template
        active_checks_enabled           1       		; Active service checks are enabled
        passive_checks_enabled          1    		   	; Passive service checks are enabled/accepted
        parallelize_check               1       		; Active service checks should be parallelized (disabling this can lead to major performance problems)
        obsess_over_service             1       		; We should obsess over this service (if necessary)
        check_freshness                 0       		; Default is to NOT check service 'freshness'
        notifications_enabled           1       		; Service notifications are enabled
        event_handler_enabled           1       		; Service event handler is enabled
        flap_detection_enabled          1       		; Flap detection is enabled
        failure_prediction_enabled      1       		; Failure prediction is enabled
        process_perf_data               1       		; Process performance data
        retain_status_information       1       		; Retain status information across program restarts
        retain_nonstatus_information    1       		; Retain non-status information across program restarts
        is_volatile                     0       		; The service is not volatile
        check_period                    24x7			; The service can be checked at any time of the day
        max_check_attempts              3			; Re-check the service up to 3 times in order to determine its final (hard) state
        normal_check_interval           10			; Check the service every 10 minutes under normal conditions
        retry_check_interval            5			; Re-check the service every two minutes until a hard state can be determined
    	notification_options		w,u,c,r			; Send notifications about warning, unknown, critical, and recovery events
        notification_interval           1440			; Re-notify about service problems every hour
        notification_period             24x7			; Notifications can be sent out at any time
        register                        0       		; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
        action_url /nagios/pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='/nagios/pnp4nagios/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
                                                        ; pnp4nagios integration
        }

Re: Send notifications for a service to other contact than a

Posted: Wed Jul 09, 2014 4:51 pm
by tmcdonald
Can you post the configs for the admin contactgroup and the updates contact?

Re: Send notifications for a service to other contact than a

Posted: Thu Jul 10, 2014 5:11 am
by AlbertP
Actually I think I have found the problem; there was also a host template that included a contact_group admins.

Re: Send notifications for a service to other contact than a

Posted: Thu Jul 10, 2014 4:43 pm
by sreinhardt
That would do it! Are you all set then, everything working properly?