DistributedArchitecture 


A distributed architecture is based on central monitoring servers and several satellite monitors. The central server consolidates all monitoring data and offers a user interface which also offers the possibility to monitor and manage the central server and the satellite monitors. The satellite monitors send their check results to the central server. This type of setup permits distribution of checks - for any type of reason f.e. remote locations, DMZ, etc.

DistribArchSchema.png

In practice, centcore takes care of the data transfers between the different servers. The central server has to be equipped with a complete monitoring installation (Nagios, Centreon, NDOutils, MySQL, etc.), in contrast with the satellite monitors that only have Nagios and NDOutils installed.


Contents

[hide]

Setting up key authentication using SSH

On the central server generate a key pair using ssh-keygen. Accept all defaults.

# su - nagios
# ssh-keygen
> Enter file in which to save the key (/usr/local/nagios/.ssh/id_rsa):
> Created directory '/usr/local/nagios/.ssh'.
> Enter passphrase (empty for no passphrase):
> Enter same passphrase again:
> Your identification has been saved in /usr/local/nagios/.ssh/id_rsa.

Transfer the public key to the satellite monitor for the Nagios daemon owner. (Replace {IP_ADDRESS} with the IP address of the satellite monitor.)

# ssh-copy-id -i ~/.ssh/id_rsa.pub nagios@{IP_ADDRESS}

The last command will ask for the password of nagios on the satellite monitor. If these steps are succesfully completed, you should be able to log on to the satellite monitor via SSH without entering a password.

Plugin duplication

Copy all plugins from the central server to the satellite monitor:

# scp /usr/local/nagios/libexec/* nagios@{IP_ADDRESS}:/usr/local/nagios/libexec/

Warnings:

  • Installation path of nagios plugins must be the same on ALL nodes, as they share ressources.cfg where $USER1$ macro defines the path!

  • When copying plugins be carefull about the architecture of your main centreon server and the remote poller (32 bits and 64 bits kernel). If your plugins were compiled on a 64 bits architecture it will not run on a 32 bits system.

Centreon configuration

Connect to the Centreon interface and configure the satellite monitor.

Configuration > Centreon > Pollers > Add
(Status: enabled, Localhost: no, IP address, etc.)

DistribArchConfPoller.png

Next, duplicate the ndomod configuration for the new poller.

Configuration > Centreon > ndomod.cfg.
Select action "Duplicate".
(Status: enabled, Requester: the name of the freshly created poller, IP address: the IP address of the central server, Instance name: must be unique)

DistribArchConfNdomod.png

Next, also duplicate the nagios configuration for the new poller.

Configuration > Nagios > nagios.cfg
Select action "Duplicate".
(Status: enabled, Server Nagios configured: the name of the freshly created poller)

DistribArchConfNagios.png

SUDO configuration

In order to allow the central server to manage the Nagios daemon on the satellite monitor, sudo has to be configured. Edit /etc/sudoers and add the following lines:

nagios   ALL=NOPASSWD: /etc/init.d/nagios restart
nagios   ALL=NOPASSWD: /etc/init.d/nagios stop
nagios   ALL=NOPASSWD: /etc/init.d/nagios start
nagios   ALL=NOPASSWD: /etc/init.d/nagios reload
nagios   ALL=NOPASSWD: /usr/sbin/nagiostats
nagios   ALL=NOPASSWD: /usr/sbin/nagios *

The use of "visudo" command is preferd to edit /etc/sudoers file.

Finalization

Make sure centcore is running on the central server. If it is not running, start it:

# /etc/init.d/centcore start

Hosts configuration

Finally, attach host/services to the new poller and generate the configuration for all servers, take a beer and watch your setup go.DistribArchConfHost.png

Some remarks/tips/advice

  • Remote pollers only are supported from version Centreon 2 beta 5.

  • NDOutils do not give a lot information on why things just won't work so make sure NDOutils are compiled with mysql support - review the config.log carefully. If NDO2DB is working, you should see a mysql session for the configured user on the configured database.

  • The procedures to restart, reload, ... nagios as well as the transfer of configs to remote pollers are called via a command file (/var/lib/centreon/centcore.cmd). Make sure the both the Apache and Centcore owner can create and modify this command file.

  • After moving a host to another poller, the host and it's services will show up twice in Centreon under 'Monitoring'. The tables in the centstatus database should be purged after moving a host.