Selecting hosts in both hostgroups (union problem).

Andreas Ericsson ae at op5.se
Fri Oct 28 11:02:19 CEST 2005


John P. Rouillard wrote:
> Hello all:
> 
> I am using nagios2.0b4 and have a problem where I need to run a
> service check on only hosts that are common to two hostgroups.
> 
>     E.G. http_servers & dont_page_for_these_hosts
> 
> I looking through the code, I didn't see anything similar to
> 
>   hostgroup_names    hostgroup1,&hostgroup2
> 
> to make a union of the two hostgroup sets so I figured I could do:
> 
>    hostgroup1, !(hostgroup of all hosts except the hosts in hostgroup2)
> 
> However how do I create the second group?
> 
> Sadly something like:
> 
>   define hostgroup{
>       hostgroup_name 	and_hostgroup2
>       members 		*	  
>       hostgroup_members !hostgroup2
>   }
> 
> doesn't work. So does anybody have any bright ideas? I may have 30 or
> 40 services defined this way, and it would be much nicer and less
> error prone to define one hostgroup as a mask rather than define 40
> hostgroups one for each service pairing.
> 

Create a second hostgroup containing the hosts this check is supposed to 
be run on. They obviously have something in common anyways, so it's not 
necessarily bad logic.

> Also is there a way to create an "invisible" hostgroup that won't show
> up in the web interface, but works in the configuration files?
> 

Not without patching the cgi's, no.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list