Services inherit host template

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
nagniot
Posts: 11
Joined: Thu Aug 02, 2012 8:26 am

Services inherit host template

Post by nagniot »

Hello everyone

I have found strange error in host definition. I have:
define host{
contact_groups mail_contact_group
#contacts sms_host_contact
}
I use this template for my host.
In template for services i have:
define service{
contact_groups mymail
}
Problem occurs when i'm deleting "#" from host template. Then i have strange situation. When i check configuration for host in Default Contacts/Groups hosts have mail_contact_group and sms_host_contact. This is good but when i also check service configuration, every service has mail_contact_group and sms_host_contact.
I don't want to use sms_host_contact for services.

How it is possible to inherit contacts for service from host template?

Do you have any idea?
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Services inherit host template

Post by nscott »

If you don't want that inherited from the host template, you can give the directive

contacts null

Which will override any thing that is further down the inheritance chain.
Nicholas Scott
Former Nagios employee
nagniot
Posts: 11
Joined: Thu Aug 02, 2012 8:26 am

Re: Services inherit host template

Post by nagniot »

Thank you :)
Locked