Page 1 of 1

Services not getting contact_groups from host settings

Posted: Fri Jul 18, 2014 2:59 pm
by ksw139
As I understood it, if I add another group to the contact_groups on one of my hosts, the services associated with this host should use the same contact_groups. In my case, the services are all being associated by a hostgroup. Below are my settings... I don't think I have any problem with my contact or contact group, b/c I do get notifications properly on the host itself, just not on the services for that host. What am I doing wrong?

define host{
name windows-server ; The name of this host template
use generic-host ; Inherit default values from the generic-host template
check_period 24x7 ; By default, Windows servers are monitored round the clock
check_interval 5 ; Actively check the server every 5 minutes
retry_interval 1 ; Schedule host check retries at 1 minute intervals
max_check_attempts 10 ; Check each server 10 times (max)
check_command check-host-alive ; Default command to check if servers are "alive"
notification_period 24x7 ; Send notification out at any time - day or night
notification_interval 240 ; Resend notifications every 30 minutes
notification_options d,r ; Only send notifications for specific host states
contact_groups admins ; Notifications get sent to the admins by default
hostgroups windows-servers ; Host groups that Windows servers should be a member of
register 0 ; DONT REGISTER THIS - ITS JUST A TEMPLATE
}

define host{
use windows-server
host_name SQL1
alias SQL1
address 170.47.14.104
contact_groups SQL
}

define hostgroup{
hostgroup_name windows-servers ; The name of the hostgroup
alias Windows Servers ; Long name of the group
}

define service{
use generic-service
hostgroup_name windows-servers
service_description Memory Usage
check_command check_nt!MEMUSE!-w 80 -c 90
}

Re: Services not getting contact_groups from host settings

Posted: Mon Jul 21, 2014 3:44 pm
by lmiltchev
What happens if you remove the "SQL" contact group from the " SQL1" host definition, and add it to the "windows-server" template?

Re: Services not getting contact_groups from host settings

Posted: Mon Jul 21, 2014 8:08 pm
by ksw139
If I do that, won't it be the contact group for all windows servers that use that template? I was trying to just have this group receive notifications for my SQL servers only, which it does when i add the SQL group to the host, it's just not getting the services associated with that host. My admins group is already on as a contact_group on the template and I get notifications on everything just fine.

Re: Services not getting contact_groups from host settings

Posted: Wed Jul 23, 2014 12:44 pm
by tmcdonald
If your generic-service template is anything like mine, then the contact_groups is already set to "admin" meaning your Memory Usage service may not be inheriting from the host:

http://nagios.sourceforge.net/docs/3_0/ ... tance.html
2014-07-23 12_45_41-Object Inheritance.png
You might try adding "contact_groups +SQL" to your service definition.

Re: Services not getting contact_groups from host settings

Posted: Tue Aug 05, 2014 12:38 pm
by ksw139
tmcdonald wrote:
You might try adding "contact_groups +SQL" to your service definition.
If I add contact_groups +SQL to my service def, won't that affect all hosts with that service?

Re: Services not getting contact_groups from host settings

Posted: Wed Aug 06, 2014 10:03 am
by tmcdonald
You can always copy the service file and add the +SQL to the new one, and just make sure the only hosts in this new service config are the ones that need the SQL group, then remove those hosts from the old one.