hostgroup.cfg file

Andreas Ericsson ae at op5.se
Fri May 21 16:54:07 CEST 2004


Ed.StJohn at wic-us.com wrote:
> I am running the sanity check after installing Nagios. I seem to be stuck on
> my hostgroups.cfg file. I am getting an error message that says "could not
> expand member hosts specifed in hostgroup ( config file yada yada yada line
> 21)
> 
> My hostgroup.cfg file looks like this....
> 
> define hostgroup{
> 
> hostgroup_name            nt-servers
> 
> alias                             NT Servers
> 
> contact_groups              nt-admins
> 
> members                       WUSNE227,WUSNE187, etc,etc
> 
> }
> 
>  
> 
> I have edited my /etc/hosts file with all of the server names and IP address
> and I can ping them all by name.
> 
> What am I missing?
> 
Probably identical spelling. Check it over a couple of times (or better 
still, have a script check it for you, so you KNOW it's not because of 
spelling issues).
Try this, for instance (without any linebreaks);

for host in `sed 's/^ *//' hostgroups.cfg | grep ^members | gawk '{ 
print $2 }' | sed 's/,/ /g'` ; do grep hostname hosts.cfg | gawk '{ 
print $2 }' | grep -q $host || echo "$host not mentioned in hosts.cfg" ; 
done

Two things worth remembering;
All variables are case sensitive.
Spaces are NOT allowed in commaseparated lists.

>  
> 
> Thank you for the help!
> 
You're welcome.

>  
> 
> Regards,
> 
> Ed St.John
> 

-- 
Sourcerer / Andreas Ericsson
OP5 AB
+46 (0)733 709032
andreas.ericsson at op5.se


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
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