Need additional contacts to be notified for service notif

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
User avatar
sushant4tech
Posts: 25
Joined: Fri Jul 31, 2015 12:24 am

Need additional contacts to be notified for service notif

Post by sushant4tech »

Hi All,

I have set up few hosts and services on Nagios Core model. For notifications sent to the contacts in case of warning and critical states, the hosts and services refer to the generic config files. I have created a contact group "admins" which has members that needs to know about states of all hosts and services. Other than the contacts defined in admins group there are some contacts which specificly needs to know about a particular host or service (the hosts or services of their interest).

Since all the hosts and services i defined use generic host/service template, i am having hard time figuring out how to notify additional contacts (specific contacts for specific host/services). Because not all contacts are interested in knowing the state of all hosts and services except the admins. if i add any member in the generic template then by definition all contacts will get notified.

If i add members in definition of host or service, will the notifications sent to admins(defined in generic definition) + selected contact (defined in the host/service definition)?
- $u$h@nT
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Need additional contacts to be notified for service noti

Post by tgriep »

Yes, if you add the specific contacts to the host / service checks they will be notified as well as the contact groups through the template assigned to those checks.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Need additional contacts to be notified for service noti

Post by Box293 »

sushant4tech wrote:If i add members in definition of host or service, will the notifications sent to admins(defined in generic definition) + selected contact (defined in the host/service definition)?
Make sure all the contact/contactgroup objects are defined with a + sign to ensure they are additive.

https://assets.nagios.com/downloads/nag ... tance.html
Read the bit Additive Inheritance of String Values.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
sushant4tech
Posts: 25
Joined: Fri Jul 31, 2015 12:24 am

Re: Need additional contacts to be notified for service noti

Post by sushant4tech »

Hello tgriep,

Thank you for the tip. I am replying late but wanted closure on this post.
Make sure all the contact/contactgroup objects are defined with a + sign to ensure they are additive.
This works. I added contact group as in the code below in the definition of host/services and now i can have a custom contact for any notification for specific host or service.

Code: Select all

define service{
                use                     generic-service
                host_name               gts-db
                service_description     Mysql Server
                check_command           check_mysql_cmdlinecred!wtraffline!traffline!gts
                contact_groups          +db_notif
}
I can use 'contact group name' defined in contacts.cfg. in front of the '+' in code above and this specific group gets the notification.

Thanks, this is sorted.
- $u$h@nT
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Need additional contacts to be notified for service noti

Post by hsmith »

Glad to hear that it is working for you now. I'll go ahead and mark this one resolved and close it.
Former Nagios Employee.
me.
Locked