此内容没有您所选择的语言版本。

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

NRPE requires OpenSSL. Install the following libraries first.

Execute the following:

[user@host]# yum install openssl openssl-devel gcc make git
Copy to Clipboard Toggle word wrap
[user@host]# apt install openssl libssl-dev gcc make git
Copy to Clipboard Toggle word wrap

3.2. Create a Nagios User

NRPE installation requires a Nagios user. So create the user first.

[user@mon]# useradd nagios
[user@mon]# passwd nagios
Copy to Clipboard Toggle word wrap

3.3. Download, Make and Install the Nagios Plug-ins

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
Copy to Clipboard Toggle word wrap

3.4. Download, Make and Install the Nagios Ceph Plug-ins

Download the latest verion of the Ceph plug-ins. See https://github.com/valerytschopp/ceph-nagios-plugins for details.

[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
Copy to Clipboard Toggle word wrap

3.5. Install xinetd

NRPE uses xinetd for communication. Install it before installing the NRPE module. Execute the following:

[user@mon]# yum install xinetd
Copy to Clipboard Toggle word wrap
[user@mon]# apt install xinetd
Copy to Clipboard Toggle word wrap

3.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
Copy to Clipboard Toggle word wrap

Then, add nrpe 5666/tcp to the /etc/services file.

3.7. Enable, Restart and Reload xinetd.

[user@mon]# systemctl enable xinetd
[user@mon]# systemctl restart xinetd
[user@mon]# systemctl reload xinetd
Copy to Clipboard Toggle word wrap

3.8. Enable and Start NRPE

[user@mon]# systemctl enable nrpe
[user@mon]# systemctl start nrpe
Copy to Clipboard Toggle word wrap

3.9. Open Port 5666

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
Copy to Clipboard Toggle word wrap
[user@mon]# iptables -A INPUT -p tcp --dport 5666 -j ACCEPT
[user@mon]# apt-get install iptables-persistent
Copy to Clipboard Toggle word wrap

3.10. Add the Nagios Core Server IP Address

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.

[user@mon]# vim /etc/xinetd.d/nrpe
Copy to Clipboard Toggle word wrap
# 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>
    log_on_success  =
}
Copy to Clipboard Toggle word wrap

Add the IP address of the Nagios Core server to the only_from setting. Then, restart xinetd.

[user@mon]# systemctl restart xinetd
Copy to Clipboard Toggle word wrap

Edit the NRPE configuration with the Nagios server’s IP address.

[user@mon]# vim /usr/local/nagios/etc/nrpe.cfg
Copy to Clipboard Toggle word wrap
allowed_hosts=127.0.0.1,<ip-address-of-nagios-core>
Copy to Clipboard Toggle word wrap

Add the IP address of the Nagios Core server to the allowed_hosts setting. Then, restart nrpe.

[user@mon]# systemctl restart nrpe
Copy to Clipboard Toggle word wrap

3.11. Test the Installation

Ensure that the make and install procedures worked.

[user@host]# /usr/local/nagios/libexec/check_nrpe -H localhost
Copy to Clipboard Toggle word wrap

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

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat