<< Back to man.ChinaUnix.net

1. Organizing Your Config Files

So far, we've modified the sample file called minimal.cfg (originally minimal.sample). Using the minimal sample is ideal for getting started, and by all means, you're free to use run Nagios in that configuration if you wish. At this stage however, it's worth pointing out that you can split your configurations into separate config files to help make things more manageable.

Straight from the documentation, we can see how this works:

# 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=/usr/local/etc/nagios/servers

#cfg_dir=/usr/local/etc/nagios/printers

#cfg_dir=/usr/local/etc/nagios/switches

#cfg_dir=/usr/local/etc/nagios/routers

Here are some other examples that should give you some ideas:

Device Types

/usr/local/etc/nagios/routers

/usr/local/etc/nagios/switches

/usr/local/etc/nagios/printers

Function Type

/usr/local/etc/nagios/mailservers

/usr/local/etc/nagios/winservers

/usr/local/etc/nagios/unixservers

Topological Location

/usr/local/etc/nagios/intranet

/usr/local/etc/nagios/extranet

/usr/local/etc/nagios/border

/usr/local/etc/nagios/dmz

Physical Location

/usr/local/etc/nagios/building-1

/usr/local/etc/nagios/building-2

/usr/local/etc/nagios/building-3

/usr/local/etc/nagios/building-4

Departmental Layout

/usr/local/etc/nagios/creative

/usr/local/etc/nagios/accounts

/usr/local/etc/nagios/sales

/usr/local/etc/nagios/it

/usr/local/etc/nagios/admin

/usr/local/etc/nagios/callcentre

Area of Responsibility

/usr/local/etc/nagios/support-team

/usr/local/etc/nagios/network-team

/usr/local/etc/nagios/dev-team