Nagios Configuration Hierarchy

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
samye
Posts: 10
Joined: Tue Mar 09, 2010 6:40 pm

Nagios Configuration Hierarchy

Post by samye »

Hello,

I'm new to nagios and was wondering if there was any documentation on how the config files related that was graphical and hierarchical. I've been reading the manual and was looking for something that would tell me if you modify host.cfg and use a new host group that it must be defined in hostGroup.cfg, etc.

Also, can config files inherit in a directory structure?

I've found several how-to's for configuring directories using the types of services, such as:
objects/network/routers/
where /routers would store the config files for the routers making it easier to modify/maintain.

Can a config file be in the objects directory with generic information, then more detailed information be in the network directory, then router directories? Maybe this has been explained but I'm not finding it. We have something like this but it is all maintained in one host file. Such as: web-host is defined with all the required directives, then underneath web-host, another host is defined to use web-host.

Can these settings be split into several config files and stored in different directories?

Please let me know if I should post this elsewhere.

Kind Regards,
Carol
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Nagios Configuration Hierarchy

Post by mmestnik »

This is free form and you will find inconsistency.

The main point is to get all of your Object Definition files included in the nagios.cfg file. After that there are no rules on the organization.

Personally I hate having multiple files for things so my config looks like this. I put all the basic config that every nagios installation would have and put it all into a folder called base, this is where most of the temples live. Then I put my personal configs(like email addresses and phone numbers) and other such configurations that every nagios install would have but every one would have something different into a folder called generic.

After that I made folders for each location and instead of using the break down that Nagios uses by default I'd group the hosts/switches/servers/ect into .cfg files and place the hostgroup, contactgroup, hosts, services, contacts, ect that wererelated to them all into that file. Though templates were used so these definitions were quite small and the base/general folder had service checks and hostgoups for linux and windows servers ect.
samye
Posts: 10
Joined: Tue Mar 09, 2010 6:40 pm

Re: Nagios Configuration Hierarchy

Post by samye »

Thank you, I appreciate the information.
Regards,,,Carol
Locked