Professional Documents
Culture Documents
Centos 7
Instalación en cliente
https://support.nagios.com/kb/article.php?id=515#CentOS
no
NRPE - How To Install NRPE v3 From Source
Article Number: 515 | Rating: 4.6/5 from 16 votes | Last Updated by swilkerson on Fri, May 3, 2019
at 11:34 AM
This procedure is intended for Nagios XI administrators who are new to NRPE or Nagios XI
NSTI (4) and have to use a source-based install method for NRPE, usually due to unsupported Linux
no distributions or security restrictions in corporate environments.
This guide is broken up into several sections and covers different Linux distributions and non
Linux operating systems.
If you only want to install the check_nrpe plugin, refer to the section at the bottom of this
KB article.
Support
Options (10)
NRPE 3.2.1 and Nagios Plugins 2.2.1 is what this guide instructs you to install, however
no future versions should also work fine with these steps.
Recently It is assumed that you are logged onto the machine you are installing NRPE as the root user,
Viewed or a user with sufficient privileges. All of the steps below were tested on the operating
NRPE - How systems (OS) listed after a clean install of the OS. Some OS's like Ubuntu and SUSE have
To Install stricter user permissions, in those cases the listed commands have sudo in front of them to
NRPE v3 ensure you are able to complete the steps. A best effort has been made to ensure if you follow
all the relevant steps you will end up with a working installation of NRPE.
From Source
Please select your OS:
Prerequisites
Compile
Note that if you want to pass arguments through NRPE you must specify this in the
configuration option as indicated below. If you prefer to you can omit the --enable-
command-args flag. Removing this flag will require that all arguments be explicitly set in
the nrpe.cfg file on each server monitored.
cd /tmp/nrpe-nrpe-3.2.1/
./configure --enable-command-args
make all
make install-groups-users
Install Binaries
This step installs the binary files, the NRPE daemon and the check_nrpe plugin.
If you only wanted to install the daemon, run the command make install-daemon
instead of the command below. However it is useful having the check_nrpe plugin
installed for testing purposes.
If you only wanted to install the check_nrpe plugin, refer to the section at the bottom of
this KB article as there a lot of steps that can be skipped. Installing only the plugin is usually
done on your Nagios server and workers.
make install
make install-config
The /etc/services file is used by applications to translate human readable service name
into port numbers when connecting to a machine across a network.
echo >> /etc/services
echo '# Nagios services' >> /etc/services
echo 'nrpe 5666/tcp' >> /etc/services
===== CentOS 5.x / 6.x | RHEL 5.x / 6.x | Oracle Linux 5.x / 6.x =====
make install-init
make install-init
systemctl enable nrpe.service
Configure Firewall
Port 5666 is used by NRPE and needs to be opened on the local firewall.
===== CentOS 5.x / 6.x | RHEL 5.x / 6.x | Oracle Linux 5.x / 6.x =====
The file nrpe.cfg is where the following settings will be defined. It is located:
/usr/local/nagios/etc/nrpe.cfg
allowed_hosts=
At this point NRPE will only listen to requests from itself (127.0.0.1). If you wanted your
nagios server to be able to connect, add it's IP address after a comma (in this example it's
10.25.5.2):
allowed_hosts=127.0.0.1,10.25.5.2
dont_blame_nrpe=
This option determines whether or not the NRPE daemon will allow clients to specify
arguments to commands that are executed. We are going to allow this, as it enables more
advanced NPRE configurations.
dont_blame_nrpe=1
sed -i '/^allowed_hosts=/s/$/,10.25.5.2/'
/usr/local/nagios/etc/nrpe.cfg
sed -i 's/^dont_blame_nrpe=.*/dont_blame_nrpe=1/g'
/usr/local/nagios/etc/nrpe.cfg
start nrpe
Test NRPE
/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
NRPE v3.2.1
If you get the NRPE version number (as shown above), NRPE is installed and configured
correctly.
You can also test from your Nagios host by executing the same command above, but instead
of 127.0.0.1 you will need to replace that with the IP Address / DNS name of the machine
with NRPE running.
Different Linux distributions have different methods of starting / stopping / restarting / status
NRPE.
NRPE needs plugins to operate properly. The following steps will walk you through installing
Nagios Plugins.
These steps install nagios-plugins 2.2.1. Newer versions will become available in the future
and you can use those in the following installation steps. Please see the releases page on
GitHub for all available versions.
Please note that the following steps install most of the plugins that come in the Nagios Plugin
package. However there are some plugins that require other libraries which are not included
in those instructions. Please refer to the following KB article for detailed installation
instructions:
Prerequisites
cd /tmp
wget http://archives.fedoraproject.org/pub/archive/epel/epel-release-
latest-5.noarch.rpm
rpm -ihv epel-release-latest-5.noarch.rpm
yum install -y gcc glibc glibc-common make gettext automake wget
openssl-devel net-snmp net-snmp-utils
yum install -y perl-Net-SNMP
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
tar xzf autoconf-2.60.tar.gz
cd /tmp/autoconf-2.60
./configure
make
make install
cd /tmp
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-
6.noarch.rpm
rpm -ihv epel-release-latest-6.noarch.rpm
yum install -y gcc glibc glibc-common make gettext automake autoconf
wget openssl-devel net-snmp net-snmp-utils
yum install -y perl-Net-SNMP
cd /tmp
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-
7.noarch.rpm
rpm -ihv epel-release-latest-7.noarch.rpm
subscription-manager repos --enable=rhel-7-server-optional-rpms
yum install -y gcc glibc glibc-common make gettext automake autoconf
wget openssl-devel net-snmp net-snmp-utils
yum install -y perl-Net-SNMP
===== Oracle Linux 7.x =====
Compile + Install
cd /tmp/nagios-plugins-release-2.2.1/
./tools/setup
./configure
make
make install
Now you can check that NRPE is executing plugins correctly. The default configuration file
/usr/local/nagios/etc/nrpe.cfg has the following command defined in it:
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c
30,25,20
You can also test from your Nagios host by executing the same command above, but instead
of 127.0.0.1 you will need to replace that with the IP Address / DNS name of the machine
with NRPE running.
INSDTALACION EN NAGIOS
https://exchange.nagios.org/directory/Addons/Monitoring-Agents/NRPE--2D-
Nagios-Remote-Plugin-Executor/details
CONFIGURACIONES ESPECIALES
En el cliente modificar
El archivo /etc/nagios/nrpe.cfg
allowed_hosts=127.0.0.1,10.10.36.10,::1
nombre comando
command[check_sda4
comando a ejecutar
https://darktraining.com/centos/linux/2009/04/08/installing-nrpe-nagios-
client-on-centos-5/
descargar
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-
2.12.tar.gz --no-check-certificate
descomprimir paquete
tar -xvzf nrpe-2.12.tar.gz
ingresar al directorio
cd nrpe-2.12
$ mkdir ~/src/
$ cd ~/src/
$ wget https://www.openssl.org/source/openssl-1.0.2a.tar.gz
$ tar -zxvf openssl-*.tar.gz
$ cd openssl-*
$ ./config -fpic shared && make && make install
/etc/ld.so.conf
$ echo "/usr/local/ssl/lib" >>
$ ldconfig
cURL Package
This installs curl in /usr/local/bin/curl
Para instalar curl se debe copiar el instalador en la ruta para luego descomprimirlo
$ cd /root/src
$ wget http://curl.haxx.se/download/curl-7.42.1.tar.gz
$ tar -xzvf curl-*.tar.gz
$ cd curl-*
$ ./configure --with-ssl=/usr/local/ssl --disable-ldap && make && make install
checking for type of socket size... size_t checking for SSL headers...
SSL headers found in /usr checking for SSL libraries... configure: error:
Cannot find ssl libraries I have installed libssl-dev and openssl package
as i found them as a solution for this error. I tried the following
option also ./configure --with-ssl=/usr/bin/openssl --with-ssl-
lib=/usr/lib But the error remains. What can be the possible solution for
this ? I am using ubuntu 12.04 as my operating system. Thanks in advance.
Solutions Sample (Please watch the whole video to see all solutions, in
order of how many people found them helpful): == This solution helped 22
people == this worked for me:
make all
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd
Now we need to install the plug-ins so we will grab them from Nagios as well on the
download page
wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
tar -xf nagios-plugins-2.0.3.tar.gz
cd nagios-plugins-2.0.3
./configure -prefix=/usr/local/nagios
make
make install
Now in the configuration find and update the allowed hosts line to be the IP of your nagios
server(s)
vi /usr/local/nagios/etc/nrpe.cfg
....
<strong>allowed_hosts=192.168.10.186</strong>
If your server has more than one NIC you may also want to update the line
"server_address" as well to reflect the interface you want the NRPE to work on.
Now we need to update the xinetd file to listed for our server: (note that in this case I am
saying the actual nagios SERVER is 192.168.10.186, this should not the IP of this host,
rather it's the server.)
vi /etc/xinetd.d/nrpe
...
only_from = 127.0.0.1
CHANGE TO
only_from = 192.168.10.186
If you have more than one Nagios server, you would seperate them with a ','.
vi /etc/services
....
nrpe 5666/tcp
crear exepciones en el fw de la planta
Now you should be able to add the host as normal to your nagios server config files.
You can test that everything is working by using the following command on the host:
/usr/local/nagios/libexec/check_nrpe -H localhost
NRPE v2.12
You can run that same command on the Nagios server but specify the host's IP that you
want to check (the IP address of the machine you just installed all of this onto.).
/usr/local/nagios/libexec/check_nrpe -H 192.168.10.55
pgrep nrpe
para reiniciarlo