separate services in according to hostgroup

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
mrninni
Posts: 27
Joined: Tue Sep 27, 2011 8:35 am

separate services in according to hostgroup

Post by mrninni »

Hi all,

I'd like to create a host with 2 services and 2 hostgroups.
I want to put in the first hostgroup the host and only one service, and in the second hostgroup the host and only the other service.
There is a way to separate the services of the same host in according to the hostgroup that contains the host?

thanks
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: separate services in according to hostgroup

Post by jsmurphy »

Easy to do!
1. Create the two hostgroups
2. Assign the services to the respective hostgroup using the "hostgroup_name" directive instead of "host_name" in the service definition.
3. Assign the two hostgroups to that host using the "hostrgroups" directive in the host definition.

This is my favourite way to handle service inheritance :)
Locked