Inheritance Contact_groups and hostgroups


#1

Hello,

I am new to the board so I hope i have not over looked the answer anywhere on the board or google.

Here is my problems.

I have a hostgroup that has services assigned to it so when I add a server I just add it to the host group and get my services with out creating each service for each host. This works great.

The problem is now I have a users that would also like to get notified for a service that is defined in my hostgroup.

I have a service that uses a template that has a default contact_group and if I user the contact_groups +groupname it works for the services I define for the host but not for the hostgroup.

I hope this makes sense I have confused my self a few times tiring to figure out how to explain it.

EXAMPLE CONFIG :
HOST CONFIG FILE:
define host{
host_name aunix-server
use unix-servers
alias aunix-server
address xxx.xxx.xxx.xxx
parents unix-router
hostgroups unix-hosts
}

define service{
host_name aunix-server
use generic-service
contact_groups +user ( This works for this service )
service_description Free Space ( /users/dir)
check_command check_remote_disk!90!95!/users/dir
}

HOSTGROUP CONFIG FILE:
define service{
hostgroup_name unix-hosts
use generic-service
servicegroups unix-service
service_description Free Space ( /tmp )
check_command check_remote_disk!90!95!/tmp
}
define service{
hostgroup_name unix-hosts
use generic-service
servicegroups unix-service
service_description Free Space ( /usr )
check_command check_remote_disk!80!90!/usr
}


#2

i’m not sure i understood … :slight_smile:

can’t you redefine all contacts for the single service where you have an extra contact? or add a contact group maybe…


#3

Let me see if I can explain my problem better.

I have a hostgroup called unix-servers in this host group I have services defined Ping, check_disk_temp, Check_disk_root and Check_database
each service uses a template that has the contact group as unix-admins. This host group has server1, server2, server3 and server4 as part of the host group.

Ok here comes the problem.

For server3 service check_database I want to also send notification to dba-admin group as well as the unix-admin group.

I hope this clarifies the mud .

Thanks
Marc


#4

what if you after defining everything you simply redefine the service check check_database for that single host with two contact groups?


#5

That does not work either plus it causes nagios check to complain about duplicate definitions and it defeats the purpose of templates and inheritance.

There is got to be a way to does this or something similar with out having to define each service for each host.

Thanks
Marc