Chapter 3. Nagios remote plug-in executor installation

As a storage administrator, you can monitor the Ceph storage cluster nodes, install Nagios plug-ins, the Ceph plug-ins and the Nagios remote plug-in executor (NRPE) add-on to each of the Ceph nodes.

For demonstration purposes, this section adds NRPE to a Ceph Monitor node with the hostname mon. Repeat the remaining procedures on all Ceph nodes that Nagios should monitor.

3.1. Installing and configuring Nagios Remote Plug-In Executor

Install the Nagios Remote Plug-in Executor (NPRE) and configure it to communicate with the Nagios Core server.

Prerequisites

  • Access to OpenSSL.
  • User-level access to Ceph Monitor node.

Procedure

  1. Install these packages on the node:

    [user@mon]# yum install openssl openssl-devel gcc make git
  2. NRPE installation requires a Nagios user. So create the user first:

    [user@mon]# useradd nagios
    [user@mon]# passwd nagios
  3. Download the latest version of the Nagios plug-ins. Then, make and install them:

    [user@mon]# wget http://www.nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz
    [user@mon]# tar zxf nagios-plugins-2.2.1.tar.gz
    [user@mon]# cd nagios-plugins-2.2.1
    [user@mon]# ./configure
    [user@mon]# make
    [user@mon]# make install
  4. NRPE uses xinetd for communication. Install it before installing the NRPE module:

    [user@mon]# yum install xinetd
  5. Download the latest verion of the Ceph plug-ins:

    [user@mon]# cd ~
    [user@mon]# git clone --recursive https://github.com/valerytschopp/ceph-nagios-plugins.git
    [user@mon]# cd ceph-nagios-plugins
    [user@mon]# make dist
    [user@mon]# make install
  6. Download, make and install Nagios NRPE:

    [user@mon]# cd ~
    [user@mon]# wget https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-3.1.0/nrpe-3.1.0.tar.gz
    [user@mon]# tar xvfz nrpe-3.1.0.tar.gz
    [user@mon]# cd nrpe-3.1.0
    [user@mon]# ./configure
    [user@mon]# make all
    [user@mon]# make install-groups-users
    [user@mon]# make install
    [user@mon]# make install-config
    [user@mon]# make install-init
  7. Edit the the /etc/services file, and add the service string nrpe 5666/tcp:
  8. Open port 5666 to allow communication with NRPE:

    [user@mon]# firewall-cmd --zone=public --add-port=5666/tcp
    [user@mon]# firewall-cmd --zone=public --add-port=5666/tcp --permanent

Additional Resources

3.2. Starting the Nagios Remote Plug-in Executor service

Start the Nagios Remote Plug-in Executor service to collect data and report it back to the Nagios Core server.

Prerequisites

  • User-level access to the Ceph Monitor node

Procedure

  1. Enable, restart, and reload xinetd:

    [user@mon]# systemctl enable xinetd
    [user@mon]# systemctl restart xinetd
    [user@mon]# systemctl reload xinetd
  2. Enable and start NRPE:

    [user@mon]# systemctl enable nrpe
    [user@mon]# systemctl start nrpe

3.3. Configuring Nagios Core server access to remote nodes

In order for the Nagios Core server to access Nagios Remote Plugin Executor (NPRE) on a remote machine, the remote machine’s xinetd and NRPE configurations must be updated with the IP address of the Nagios Core server.

Prerequisites

  • User-level access to the Nagios Core server.
  • Internet access.
  • Access to the Nagios Remote Plugin Executor.

Procedure

  1. Edit the xinetd configuration with the Nagios server’s IP address:

    [user@mon]# vi /etc/xinetd.d/nrpe
    # default: off
    # description: NRPE (Nagios Remote Plugin Executor)
    service nrpe
    {
        disable         = yes
        socket_type     = stream
        port            = 5666
        wait            = no
        user            = nagios
        group           = nagios
        server          = /usr/local/nagios/bin/nrpe
        server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd
        only_from       = 127.0.0.1,IP_ADDRESS_OF_NAGIOS_CORE_SERVER
        log_on_success  =
    }
  2. After adding the IP address of the Nagios Core server to the only_from option, restart the xinetd service:

    [user@mon]# systemctl restart xinetd
  3. Edit the NRPE configuration with the Nagios server’s IP address:

    [user@mon]# vi /usr/local/nagios/etc/nrpe.cfg
    allowed_hosts=127.0.0.1,IP_ADDRESS_OF_NAGIOS_CORE_SERVER
  4. Add the IP address of the Nagios Core server to the allowed_hosts setting. Then, restart nrpe:

    [user@mon]# systemctl restart nrpe
  5. Test the installation:

    [user@host]# /usr/local/nagios/libexec/check_nrpe -H localhost

    The check should echo NRPE v3.1.0-rc1 if it is working correctly.