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 Install these packages on the node: NRPE installation requires a Nagios user. So create the user first: Download the latest version of the Nagios plug-ins. Then, make and install them: NRPE uses xinetd for communication. Install it before installing the NRPE module: Download the latest verion of the Ceph plug-ins: Download, make and install Nagios NRPE: Edit the the /etc/services file, and add the service string nrpe 5666/tcp : Open port 5666 to allow communication with NRPE: Additional Resources See https://github.com/valerytschopp/ceph-nagios-plugins for details. 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 Enable, restart, and reload xinetd : Enable and 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 Edit the xinetd configuration with the Nagios server's IP address: After adding the IP address of the Nagios Core server to the only_from option, restart the xinetd service: Edit the NRPE configuration with the Nagios server's IP address: Add the IP address of the Nagios Core server to the allowed_hosts setting. Then, restart nrpe : Test the installation: The check should echo NRPE v3.1.0-rc1 if it is working correctly.

Commands:
yum install openssl openssl-devel gcc make git
useradd nagios passwd nagios
wget http://www.nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz tar zxf nagios-plugins-2.2.1.tar.gz cd nagios-plugins-2.2.1 ./configure make make install
yum install xinetd
cd ~ git clone --recursive https://github.com/valerytschopp/ceph-nagios-plugins.git cd ceph-nagios-plugins make dist make install
cd ~ wget https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-3.1.0/nrpe-3.1.0.tar.gz tar xvfz nrpe-3.1.0.tar.gz cd nrpe-3.1.0 ./configure make all make install-groups-users make install make install-config make install-init
firewall-cmd --zone=public --add-port=5666/tcp firewall-cmd --zone=public --add-port=5666/tcp --permanent
systemctl enable xinetd systemctl restart xinetd systemctl reload xinetd
systemctl enable nrpe systemctl start nrpe
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 = }
systemctl restart xinetd
vi /usr/local/nagios/etc/nrpe.cfg
allowed_hosts=127.0.0.1, IP_ADDRESS_OF_NAGIOS_CORE_SERVER
systemctl restart nrpe
/usr/local/nagios/libexec/check_nrpe -H localhost