Chapter 3. Installing Nagios Remote Plug-in Executor (NRPE)
To monitor Ceph Storage cluster hosts, install Nagios Plug-ins, the Ceph plug-ins and the NRPE add-on to each of the Ceph cluster’s hosts.
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. Install Prerequisites Copy linkLink copied to clipboard!
NRPE requires OpenSSL. Install the following libraries first.
Execute the following:
yum install openssl openssl-devel gcc make git
[user@host]# yum install openssl openssl-devel gcc make git
apt install openssl libssl-dev gcc make git
[user@host]# apt install openssl libssl-dev gcc make git
3.2. Create a Nagios User Copy linkLink copied to clipboard!
NRPE installation requires a Nagios user. So create the user first.
useradd nagios passwd nagios
[user@mon]# useradd nagios
[user@mon]# passwd nagios
3.3. Download, Make and Install the Nagios Plug-ins Copy linkLink copied to clipboard!
Download the latest version of the Nagios plug-ins. Then, make and install them.
3.4. Download, Make and Install the Nagios Ceph Plug-ins Copy linkLink copied to clipboard!
Download the latest verion of the Ceph plug-ins. See https://github.com/valerytschopp/ceph-nagios-plugins for details.
cd ~ git clone --recursive https://github.com/valerytschopp/ceph-nagios-plugins.git cd ceph-nagios-plugins make dist make install
[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
3.5. Install xinetd Copy linkLink copied to clipboard!
NRPE uses xinetd
for communication. Install it before installing the NRPE module. Execute the following:
yum install xinetd
[user@mon]# yum install xinetd
apt install xinetd
[user@mon]# apt install xinetd
3.6. Download, Make and Install Nagios NRPE Copy linkLink copied to clipboard!
Then, add nrpe 5666/tcp
to the /etc/services
file.
3.7. Enable, Restart and Reload xinetd. Copy linkLink copied to clipboard!
systemctl enable xinetd systemctl restart xinetd systemctl reload xinetd
[user@mon]# systemctl enable xinetd
[user@mon]# systemctl restart xinetd
[user@mon]# systemctl reload xinetd
3.8. Enable and Start NRPE Copy linkLink copied to clipboard!
systemctl enable nrpe systemctl start nrpe
[user@mon]# systemctl enable nrpe
[user@mon]# systemctl start nrpe
3.9. Open Port 5666 Copy linkLink copied to clipboard!
Open port 5666
to allow communication with NRPE.
firewall-cmd --zone=public --add-port=5666/tcp firewall-cmd --zone=public --add-port=5666/tcp --permanent
[user@mon]# firewall-cmd --zone=public --add-port=5666/tcp
[user@mon]# firewall-cmd --zone=public --add-port=5666/tcp --permanent
iptables -A INPUT -p tcp --dport 5666 -j ACCEPT apt-get install iptables-persistent
[user@mon]# iptables -A INPUT -p tcp --dport 5666 -j ACCEPT
[user@mon]# apt-get install iptables-persistent
3.10. Add the Nagios Core Server IP Address Copy linkLink copied to clipboard!
In order for the Nagios Core server to access NRPE on a remote machine, the remote machine’s xinetd and NRPE configurations must be updated with the IP address of the Nagios Core server.
Edit the xinetd configuration with the Nagios server’s IP address.
vim /etc/xinetd.d/nrpe
[user@mon]# vim /etc/xinetd.d/nrpe
Add the IP address of the Nagios Core server to the only_from
setting. Then, restart xinetd
.
systemctl restart xinetd
[user@mon]# systemctl restart xinetd
Edit the NRPE configuration with the Nagios server’s IP address.
vim /usr/local/nagios/etc/nrpe.cfg
[user@mon]# vim /usr/local/nagios/etc/nrpe.cfg
allowed_hosts=127.0.0.1,<ip-address-of-nagios-core>
allowed_hosts=127.0.0.1,<ip-address-of-nagios-core>
Add the IP address of the Nagios Core server to the allowed_hosts
setting. Then, restart nrpe
.
systemctl restart nrpe
[user@mon]# systemctl restart nrpe
3.11. Test the Installation Copy linkLink copied to clipboard!
Ensure that the make and install procedures worked.
/usr/local/nagios/libexec/check_nrpe -H localhost
[user@host]# /usr/local/nagios/libexec/check_nrpe -H localhost
The check should echo NRPE v3.1.0-rc1
if it is working correctly.