Error: Cannot open config file '/usr/local/nagios/etc/hosts.cfg'

Steve_Schryburt at Mitel.COM Steve_Schryburt at Mitel.COM
Mon May 16 20:23:56 CEST 2005


Jim,

I would like a hostname.cfg file for each host that I am monitoring.

My understanding is that I should be able to put hostname.cfg files into a
directory that I've identified with the cfg_dir directive
"cfg_dir=/usr/local/nagios/etc/hosts".

Here is the example in nagios.cfg:

   # You can also tell Nagios to process all config files (with a .cfg
   # extension) in a particular directory by using the cfg_dir
   # directive as shown below:

   #cfg_dir=/usr/local/nagios/etc/servers
   #cfg_dir=/usr/local/nagios/etc/printers
   #cfg_dir=/usr/local/nagios/etc/switches
   #cfg_dir=/usr/local/nagios/etc/routers

For some reason the cfg_dir directive is not working.  The pre-flight
doesn't pick up any hosts in the "/usr/local/nagios/etc/hosts" directory.

Stephen S.



                                                                                                                                 
                      "EXT-Fuentes,                                                                                              
                      James P"                 To:       <Steve_Schryburt at Mitel.COM>, <nagios-users at lists.sourceforge.net>       
                      <James.P.Fuentes at b       cc:                                                                               
                      oeing.com>               Subject:  RE: [Nagios-users] Error: Cannot open config file                       
                                                 '/usr/local/nagios/etc/hosts.cfg'                                               
                      05/16/2005 01:51                                                                                           
                      PM                                                                                                         
                                                                                                                                 
                                                                                                                                 




Do you have "cfg_file" directives for each hostname.file in your
nagios.cfg? Also, I'm a little confused on why you'd point to
"cfg_dir=/usr/local/nagios/etc/hosts". That should read
cfg_file=/usr/local/nagios/etc/hosts.cfg but it sounds like you don't want
that in favor of several other hostname.cfgs:

cfg_file=/usr/local/nagios/etc/host1.cfg
cfg_file=/usr/local/nagios/etc/host2.cfg

-Jim

________________________________

From: Steve_Schryburt at Mitel.COM [mailto:Steve_Schryburt at Mitel.COM]
Sent: Mon 5/16/2005 10:12 AM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Error: Cannot open config file
'/usr/local/nagios/etc/hosts.cfg'



I'm trying to use several host definition files, one for each monitored
system.  I'm not using hosts.cfg.

When I try staring the nagios deamon I get an error that it can't find
hosts.cfg:

Nagios 2.0b3 starting... (PID=425)
Error: Cannot open config file '/usr/local/nagios/etc/hosts.cfg' for
reading: No such file or directory


Location of of host definition files (1 per host):
/usr/local/nagios/etc/hosts/<hostname>.cfg

/usr/local/nagios/etc/nagios.cfg:
cfg_dir=/usr/local/nagios/etc/hosts


I compiled with these options:

./configure --prefix=/usr/local/nagios \
--exec-prefix=/usr/local/nagios \
--bindir=/bin \
--sbindir=/sbin \
--libexecdir=/libexec \
--datadir=/share \
--sysconfdir=/etc \
--localstatedir=/var


Thanks.
Stephen S.




-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&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









-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&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