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)?
Need additional contacts to be notified for service notif
- sushant4tech
- Posts: 25
- Joined: Fri Jul 31, 2015 12:24 am
Re: Need additional contacts to be notified for service noti
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!
- 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
Make sure all the contact/contactgroup objects are defined with a + sign to ensure they are additive.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)?
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.
- sushant4tech
- Posts: 25
- Joined: Fri Jul 31, 2015 12:24 am
Re: Need additional contacts to be notified for service noti
Hello tgriep,
Thank you for the tip. I am replying late but wanted closure on this post.
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.
Thank you for the tip. I am replying late but wanted closure on this post.
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.Make sure all the contact/contactgroup objects are defined with a + sign to ensure they are additive.
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
}
Thanks, this is sorted.
- $u$h@nT
Re: Need additional contacts to be notified for service noti
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.
me.