Chapter 3. Nagios remote plug-in executor installation
As a storage administrator, you can monitor the Ceph storage cluster hosts, install Nagios plug-ins, the Ceph plug-ins, and the Nagios remote plug-in executor (NRPE) add-on to each of the Ceph hosts.
For demonstration purposes, this section adds NRPE to a Ceph Monitor host with the hostname host01
. Repeat the remaining procedures on all Ceph hosts 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
- Root-level access to Ceph Monitor host.
Procedure
Install these packages on the host:
Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow dnf install openssl openssl-devel gcc make git
[root@host01 ~]# dnf install openssl openssl-devel gcc make git
NRPE installation requires a Nagios user. Create the user first:
Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow useradd nagios passwd nagios
[root@host01 ~]# useradd nagios [root@host01 ~]# passwd nagios
Download the latest version of the Nagios plug-ins. Then, make and install them:
Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow wget http://nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz tar zxf nagios-plugins-2.3.3.tar.gz cd nagios-plugins-2.3.3
[root@host01 ~]# wget http://nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz [root@host01 ~]# tar zxf nagios-plugins-2.3.3.tar.gz [root@host01 ~]# cd nagios-plugins-2.3.3 [root@host01 nagios-plugins-2.3.3]# ./configure [root@host01 nagios-plugins-2.3.3]# make [root@host01 nagios-plugins-2.3.3]# make install
Download the latest version of the Ceph plug-ins:
Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow git clone --recursive https://github.com/ceph/ceph-nagios-plugins.git cd ceph-nagios-plugins make dist make install
[root@host01 nagios-plugins-2.3.3]# cd ~ [root@host01 ~]# git clone --recursive https://github.com/ceph/ceph-nagios-plugins.git [root@host01 ~]# cd ceph-nagios-plugins [root@host01 ceph-nagios-plugins]# make dist [root@host01 ceph-nagios-plugins]# make install
Download, make, and install Nagios NRPE:
Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow cd ~ wget https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-4.0.3/nrpe-4.0.3.tar.gz tar xvfz nrpe-4.0.3.tar.gz cd nrpe-4.0.3
[root@host01 ceph-nagios-plugins]# cd ~ [root@host01 ~]# wget https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-4.0.3/nrpe-4.0.3.tar.gz [root@host01 ~]# tar xvfz nrpe-4.0.3.tar.gz [root@host01 ~]# cd nrpe-4.0.3 [root@host01 nrpe-4.0.3]# ./configure [root@host01 nrpe-4.0.3]# make all [root@host01 nrpe-4.0.3]# make install-groups-users [root@host01 nrpe-4.0.3]# make install [root@host01 nrpe-4.0.3]# make install-config [root@host01 nrpe-4.0.3]# make install-init
If you are using a firewall, open port
5666
to allow communication with NRPE:Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow firewall-cmd --zone=public --add-port=5666/tcp firewall-cmd --zone=public --add-port=5666/tcp --permanent
[root@host01 ~]# firewall-cmd --zone=public --add-port=5666/tcp [root@host01 ~]# firewall-cmd --zone=public --add-port=5666/tcp --permanent
Additional Resources
- For more information about Nagios plug-ins for Ceph, see Nagios plugins for Ceph.
3.2. Starting the Nagios Remote Plug-in Executor service
Start the Nagios Remote Plug-in Executor (NRPE) service to collect data and report it back to the Nagios Core server.
Prerequisites
- Root-level access to the Ceph Monitor host
Procedure
Enable and start the NRPE service:
Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl enable nrpe systemctl start nrpe
[root@host01 ~]# systemctl enable nrpe [root@host01 ~]# systemctl start nrpe
3.3. Configuring Nagios Core server access to remote nodes
For the Nagios Core server to access Nagios Remote Plugin Executor (NPRE) on a remote machine, the remote machine’s NRPE configurations must be updated with the IP address of the Nagios Core server.
Prerequisites
- Root-level access to the Nagios Core server.
- Internet access.
- Access to the Nagios Remote Plugin Executor.
Procedure
Edit the NRPE configuration with the Nagios server’s IP address:
Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow vi /usr/local/nagios/etc/nrpe.cfg
[root@host01 ~]# vi /usr/local/nagios/etc/nrpe.cfg
Add the IP address of the Nagios Core server to the
allowed_hosts
setting.Syntax
Copy to Clipboard Copied! Toggle word wrap Toggle overflow allowed_hosts=127.0.0.1,IP_ADDRESS_OF_NAGIOS_CORE_SERVER
allowed_hosts=127.0.0.1,IP_ADDRESS_OF_NAGIOS_CORE_SERVER
Replace IP_ADDRESS_OF_NAGIOS_CORE_SERVER with the IP address of your Nagios Core server.
Restart
nrpe
:Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl restart nrpe
[root@host01 ~]# systemctl restart nrpe
Verification
Test the installation:
Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow /usr/local/nagios/libexec/check_nrpe -H localhost
[root@host01 ~]# /usr/local/nagios/libexec/check_nrpe -H localhost
The check should echo
NRPE v4.0.3
if it is working correctly.