Running tests on intersection of two hostgroups?

Brock Kuhse brock at kuhsefamily.org
Mon Apr 14 15:48:15 CEST 2008


> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
> bounces at lists.sourceforge.net] On Behalf Of Hari Sekhon
> Sent: Monday, April 14, 2008 1:31 AM
> To: Nagios Users Mailinglist
> Subject: Re: [Nagios-users] Running tests on intersection of two
> hostgroups?
> 
> Hugo van der Kooij wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Kelly Jones wrote:
> > | I have a "Windows" hostgroup for my Windows machines, and an
> > | "Important" hostgroup for all my important machines (Windows and
> > | otherwise).
> > |
> > | How do I check a service on the intersection of these two groups
> (ie,
> > | important Windows machines)?
> > |
> > | I realize I could create an "important Windows" hostgroup, but that
> > | seems ugly, since I'd have to maintain it separately from the two
> > | existing hostgroups.
> >
> > If the question is if one can use boolean logic in requiring an AND
> > function in the membership of hostgroups. Then the simple answer is
> no.
> > You need to define another group with the right members yourself.
> >
> > If your question is different you may need to rephrase the question.
> >
> > Hugo
> Is there no plan to allow embedded hostgroups in Nagios?
> 
> Once you have this, you would just stick all important windows machines
> in the "Important Windows" group and then nest that group in the
> general
> "Important" group to achieve the effect of maintaining those hosts in
> only one place, scalable and consistent.
> 
> I'm not sure if this is in 3.x or planned, I don't follow the bleeding
> development track too closely...
> 
> Short of that, write a script to parse and generate another hostgroups
> file to achieve the same result and have it automated to create the
> Important group from other hostgroups and maintain your hosts in just
> those more specific hostgroups.
> 
> I did something similar to auto-generate servicegroups for all tests to
> allow easily grouping them together, you could do something similar for
> hostgroups (my script for servicegroups is released here
> http://www.nagiosexchange.org/cgi-bin/pages/Detailed/2435.html)
> 
> -h
> 
> --
> Hari Sekhon
> 

We use 3.0 and do something like that now with a group of "MS Exchange
Servers" that is embedded in the "Windows Servers" groups.  That way we just
apply the "exchange_server" template to servers running MS Exchange without
also having to apply the "windows_server" template.  

For Kelly's problem, I suppose one could define an "Important" template and
a "Windows" template, and then apply both templates to "important Windows
servers".

- Brock


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
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