Distributed setup basics (Central server's definitions?


#1

I have setup the basic Centralized/Distributed model. I have a Distributed Nagios install doing the services checks, that in turn send them via NSCA to my Central Nagios Server. To make it clear; when the Nagios documentation says:

" The central server must have service definitions for all services that are being monitored by all the
distributed servers. Nagios will ignore passive check results if they do not correspond to a service
that has been defined."

I assume this means that the Central server needs mirror copies (withholding the active service check option) of contacts,contact groups, hosts, host groups and of course services (with the passive check set to 1) from each distributed server to be able to receive, process and notify on passive checks.

Any insight would be much appreciated,

Thank You.


#2

You are correct; the central server needs a mirror copy of each of the backends’ configs with active checks disabled.

The way we set ours up, contacts and contactgroups, commands, and other general config info is directly in ~nagios/etc. Each distributed server’s hosts and service checks are in a subdirectory under ~nagios/etc. The nagios.cfg on the front-end servers contains a cfg_dir= line for each subdirectory. The nagios.cfg on a backend server contains only the cfg_dir= line for its own subdirectory.

We make config changes on one host and have a script to rsync the subdirectories and selected files from ~nagios/etc to each nagios node in the environment (i.e. contacts.cfg gets copied, nagios.cfg does not). We also have another script to restart Nagios on each server (after running -v).

YMMV… hope that was helpful!