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

Marc Powell marc at ena.com
Mon May 16 20:44:44 CEST 2005



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Steve_Schryburt at Mitel.COM
> Sent: Monday, May 16, 2005 1:24 PM
> To: EXT-Fuentes, James P
> Cc: nagios-users at lists.sourceforge.net
> Subject: RE: [Nagios-users] Error: Cannot open config file
> '/usr/local/nagios/etc/hosts.cfg'
> 
> 
> 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".

That is correct. Any files in a cfg_dir directory will be processed as
object configuration files.

> 
> 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.

Can you provide your specific cfg_dir line? If it's prefaces with a '#'
as the ones above then it's a comment and will be ignored by the daemon.
Additionally, is the directory readable by nagios?

--
Marc


-------------------------------------------------------
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_idt12&alloc_id344&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