conditional inclusion of cfg files
Justin Hitt
hittjw at gmail.com
Mon Feb 18 20:31:01 CET 2008
Jonathan,
Jonathan Mills wrote:
> > Okay, let's say you have lots of distributed pollers, which should
> > only load cfg files for their particular environment (both hosts and
> > services). However, you'd like to manage the same set of "global" cfg
I setup configurations in subdirectories by datacenter (location of
the distributed poller) then have a local 'sed' check change the
location of the configuration relevant to that specific box.
These directories are also broken out individually ...
$NAGIOS_HOME/etc/corporate/$ASSET_GROUP/{hosts,groups,contact}.cfg
$NAGIOS_HOME/etc/datacenter/$CITY_STATE/{hosts,groups,contact}.cfg
$NAGIOS_HOME/etc/thirdparty/$VENDOR/{hosts,groups,contact}.cfg
All my pollers check a common pool ("corporate", "thirdparty") and
have local checks for their own site ("datacenter".) $CITY_STATE
could also be the name of your host, that makes 'sed' a little easier.
Use 'cfg_dir='
You could use 'cfengine', I use 'sed', but just comment out all
datacenters on your console and uncomment the one necessary for a
particular datacenter. If you won't want to use 'sed' or 'cfengine'
then just uncomment it by hand.
Best,
Justin
--
Attention Sales And Marketing Professionals Who Serve B2B Executives
http://hittpublishingdirect.com/
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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