Re: [Nagios-devel] cfg_dir recursive?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] cfg_dir recursive?

Post by Guest »

Hmmm,

This may actually be an issue of priority ? I haven't tested that =20
before when doing this.

Maybe moving your .cfg files that are in customers down a level to =20
common may fix the issue. It may be trying to fully vet the file =20
before recursing into the sub dirs.

Like I say I haven't seen that before but I haven't tested it either. =20
You could also do a second cfg_dir line that points to your common =20
service group and other high level files after your customer cfg_dir =20
directive.

Try those items and see if it changes the results any.

Derrick
Quoting Jo Rhett :

> On May 3, 2008, at 2:20 PM, Tom Throckmorton wrote:
>> Jo, could you cut and paste your relevant configuration bits for
>> enabling the cfg_dir / cfg_file directives?
>
> Sure. The first part of bone stock:
>
> # You can split other types of object definitions across several
> # config files if you wish (as done here), or keep them all in a
> # single config file.
> cfg_file=3D/d/nagios/etc/contactgroups.cfg
> cfg_file=3D/d/nagios/etc/contacts.cfg
> cfg_file=3D/d/nagios/etc/dependencies.cfg
> cfg_file=3D/d/nagios/etc/escalations.cfg
> cfg_file=3D/d/nagios/etc/hostgroups.cfg
> cfg_file=3D/d/nagios/etc/hosts.cfg
> cfg_file=3D/d/nagios/etc/servicegroups.cfg
> cfg_file=3D/d/nagios/etc/service-template.cfg
> cfg_file=3D/d/nagios/etc/services.cfg
> cfg_file=3D/d/nagios/etc/timeperiods.cfg
>
> There there is the custom part. The first line is commented out
> because it doesn't work. If I use this and comment out the later
> lines then none of the configuration files in these directories are
> parsed.
>
> # 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=3D/d/nagios/etc/customers
> cfg_dir=3D/d/nagios/etc/customers/common
> cfg_dir=3D/d/nagios/etc/customers/9617
> cfg_dir=3D/d/nagios/etc/customers/9652
> cfg_dir=3D/d/nagios/etc/customers/9669
> cfg_dir=3D/d/nagios/etc/customers/9677
> cfg_dir=3D/d/nagios/etc/customers/9691
> cfg_dir=3D/d/nagios/etc/customers/9696
> cfg_dir=3D/d/nagios/etc/customers/9698
> cfg_dir=3D/d/nagios/etc/customers/9730
> cfg_dir=3D/d/nagios/etc/customers/9736
> cfg_dir=3D/d/nagios/etc/customers/9743
>
> If I uncomment the first line and comment out the later lines, I get
> the following:
>
> Performing sanity check of nagios configuration: FAILED
>
> Nagios 2.9
> Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
> Last Modified: 04-10-2007
> License: GPL
>
> Reading configuration data...
>
> Error: Servicegroup has no members (config file '/d/nagios/etc/
> servicegroups.cfg', starting on line 6)
>
> This is a hint, because every service defined in these subdirectories
> is a member of that group. If I manually add a static service to
> that group, the error goes away but none of the hosts or services
> defined in those subdirectories appear in the configuration.
>
> --
> Jo Rhett
> Net Consonance : consonant endings by net philanthropy, open source
> and other randomness
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673 ... n.com/jav=
aone
> _______________________________________________
> Nagios-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/lis ... gios-devel
>







This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked