nagios $HOSTGROUP$ macro

Andreas Ericsson ae at op5.se
Tue Aug 31 13:33:12 CEST 2004


Albert Spruyt wrote:
> hallo nagios-devel,
> 
> There doesnt seem to be a hostgroup macro,

There is in Nagios 2.0. It's a bit dubious though, since hosts can be 
members of several hostgroups and it only shows one of them. 
Documentation doesn't say anything about the rules of election.

> how hard would it be to create one?

To hack around it;

hostgroup=`grep -2 $HOSTNAME$ hostgroups.cfg | grep hostgroup_name | \
head -1 | sed 's/.*hostgroup_name[ ]*//'`

I'm sure its equally trivial in other script languages.

> and are there any reasons not to do it?

The dubiousness.

> 
> thanks in advance
> -albert spruyt
> 

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click




More information about the Developers mailing list