이 콘텐츠는 선택한 언어로 제공되지 않습니다.
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:
[user@mon]# yum install openssl openssl-devel gcc make git
NRPE installation requires a Nagios user. So create the user first:
[user@mon]# useradd nagios [user@mon]# passwd nagios
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
NRPE uses
xinetd
for communication. Install it before installing the NRPE module:[user@mon]# yum install xinetd
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
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
-
Edit the the
/etc/services
file, and add the service stringnrpe 5666/tcp
: 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
- 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
:[user@mon]# systemctl enable xinetd [user@mon]# systemctl restart xinetd [user@mon]# systemctl reload xinetd
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
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 = }
After adding the IP address of the Nagios Core server to the
only_from
option, restart thexinetd
service:[user@mon]# systemctl restart xinetd
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
Add the IP address of the Nagios Core server to the
allowed_hosts
setting. Then, restartnrpe
:[user@mon]# systemctl restart nrpe
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.