cfg_file and cfg_dir; but what about cfg_cmd??

Andreas Ericsson ae at op5.se
Fri Aug 27 09:02:52 CEST 2004


Pierce Chuck wrote:
> I know that you can create a cfg_file and cfg_dir, but what about getting
> configuration info via an external command?  Does anyone know if this is
> possible?  I would like the ability to generate (on the fly) the
> configuration for nagios, and I really don't want to have to create/maintain
> the config files on the file system (and don't want to hack it by having an
> external program create the files).
> 
> Thanks - Chuck

Simple, if you've got a bit of imagination. In your startup script, use 
something like;
nagios-config-generator > nagios-objects.cfg && nagios -d nagios.cfg

This will also prevent Nagios from trying to read the configuration in 
case something fucks up while generating it. Naturally, the file 
nagios-objects.cfg needs to be specified as a cfg_file.

You can not insert object configuration into nagios while it's running. 
I think it would wreak havoc on the hash-tables and possibly cause it to 
drop other items from the buckets.


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


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
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