Breaking up hosts.cfg into manageable files, possible?

Greg Vickers g.vickers at qut.edu.au
Thu Nov 6 01:58:20 CET 2003


Tomas,

The use of the cfg_dir directive in nagios.cfg is the only way to go; (my 
config under Debian) e.g:

cfg_dir=/etc/nagios/objects/contacts
cfg_dir=/etc/nagios/objects/timeperiods
cfg_dir=/etc/nagios/objects/hostgroups
cfg_dir=/etc/nagios/objects/hostgroups/firstdept
etc...

This way you can drop files in there with whatever name you like 
(reallybighostconfig.txt) and Nagios will parse those files - so long as 
they contain valid configuration information you are good.

Use of the cfg_dir means that if you are working on something and you just 
want to drop that configuration item out of your config for a second, 
create a subdir (/etc/nagios/objects/contacts/wip) and drop that file in 
there while troubleshooting.

I also do demarcation and granularization (sp?) - I store a general use 
template in ../services and break up all services into 
../services/firstdept, ../services/seconddept etc etc

This makes for a fairly large directory structure, but it makes 
organization of configuration items really easy.

Greg

At 01:54 AM 06/11/2003, MT Morales wrote:

>Is it possible to break up the hosts.cfg (and services.cfg) in to
>small, more manageable files (like for different types of systems)?
>i.e. do the hosts.cfg and service.cfg object files support some sort
>of "include <unix-hosts.cfg>" statement?
>
>sorry if this is too simple a question. I just haven't found anything
>that addresses that option in the docs.
>
>Any pointers on that (or solution approach) will be appreciated
>Tomas
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: SF.net Giveback Program.
>Does SourceForge.net help you be more productive?  Does it
>help you create better code?   SHARE THE LOVE, and help us help
>YOU!  Click Here: http://sourceforge.net/donate/
>_______________________________________________
>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

=================================
Greg Vickers
Computer Systems Officer
Student Support and Systems,
Teaching and Learning Support Systems,
Queensland University of Technology,
Kelvin Grove Campus,
Brisbane,
Australia

CRICOS No 00213J

Ph: 07 3864 8276 Fax: 07 3864 5425
Mob: 0416 001 674 SD: #66147 



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
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