Hostgroup subtraction?

Marc Powell marc at ena.com
Wed Jun 3 23:25:20 CEST 2009


On Jun 3, 2009, at 2:43 PM, Chris Pepper wrote:

> 	    We use several hostgroups. I'd like to ensure each host is in a
> group for its building. My concern is that we need to avoid adding a
> host without adding it to a building hostgroup.
>
> 	I tried putting the generic parent object in a hostgroup for our main
> location, and using 'hostgroups -mainlocation,+actuallocation', but
> apparently hostgroups only allows '+', not '-' or '!'.
>
> 	Is there a way to remove hosts from inherited hostgroups?

In this specific example, using the following in the host{} definition  
will override the template definition and the host would only be in  
actuallocation --

	hostgroups actuallocation

> 	Is there a way to get a negative listing: all hosts not in any of the
> (building) hostgroups?

I believe that with use_true_regexp_matching on,  'hostgroups  
actuallocation, !mainlocation' should work but I haven't tested  
that... It's the standard convention for other directives.

--
Marc


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
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