Send notifications for a service to other contact than admin

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
AlbertP
Posts: 3
Joined: Wed Jul 09, 2014 8:55 am

Send notifications for a service to other contact than admin

Post 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?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

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

Post by tmcdonald »

Does the "use service" template define the admin as a contact?
Former Nagios employee
AlbertP
Posts: 3
Joined: Wed Jul 09, 2014 8:55 am

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

Post 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
        }
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

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

Post by tmcdonald »

Can you post the configs for the admin contactgroup and the updates contact?
Former Nagios employee
AlbertP
Posts: 3
Joined: Wed Jul 09, 2014 8:55 am

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

Post by AlbertP »

Actually I think I have found the problem; there was also a host template that included a contact_group admins.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

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

Post by sreinhardt »

That would do it! Are you all set then, everything working properly?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked