Testing the configuration
Marc Powell
marc at ena.com
Fri Dec 5 00:37:45 CET 2008
On Dec 4, 2008, at 5:08 PM, David Dyer-Bennet wrote:
> separate test system, perhaps a virtual one). Are those absolute
> paths
> needed? The doc gives examples showing absolute paths, and doesn't
> talk
> about what a relative path would mean (but doesn't say it's forbidden,
> either). Are relative paths allowed? Can we predict what they'd be
> relative to?
Simple enough TAFO question. Answers appear to be no, yes and yes
respectively but absolute paths eliminate much confusion --
editing ~nagios/etc/nagios.cfg to specify --
cfg_file=etc/template.cfg
* Testing from ~nagios is successful --
nagios]$ bin/nagios -v etc/nagios.cfg
Nagios 2.7
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 01-19-2007
License: GPL
Reading configuration data...
...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-
flight check
* Testing from ~nagios/bin fails --
bin]$ ./nagios -v ../etc/nagios.cfg
Nagios 2.7
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 01-19-2007
License: GPL
Reading configuration data...
Error: Cannot open config file 'etc/template.cfg' for reading: No such
file or directory
***> One or more problems was encountered while processing the config
files...
* Editing ~nagios/etc/nagios.cfg to specify --
cfg_file=../etc/template.cfg
results in successful test --
bin]$ ./nagios -v ../etc/nagios.cfg
Nagios 2.7
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 01-19-2007
License: GPL
Reading configuration data...
...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-
flight check
So it appears possible but the paths must be referenced from your
current working directory (PWD). That's fine when launched manually
since you can always cd to the correct directory to test from but when
launched via script, care must be taken to ensure that PWD is correct.
--
Marc
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
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