Installing the nagios agent(NRPE)
-
- Posts: 27
- Joined: Mon Nov 17, 2014 12:29 pm
Installing the nagios agent(NRPE)
I untared the linux-nrpe-agent.tar.gz and ran the fullinstall script to install the nagios agent on my server and as it runs it tries to access the nagios web portal to download files to install on my server. Currently, my server is not internet accessible. Is there another tar file that I can download from the Nagios web site that has all the necessary packages, files, bin needed to install the agent without accessing the internet to pull files?
Re: Installing the nagios agent(NRPE)
You can build NRPE from source quite simply:
Prerequisites
Make sure that you have the following packages installed:
Downloading the Source
On the remote host (client system), log in as the root user to download and extract the NRPE tarball:
Compile and Installation
To compile and install NRPE, run the following commands:
The check_nrpe plugin will install into /usr/local/nagios/libexec by default.
Copy the sample nrpe.cfg file to your remote hosts' NRPE config directory:
Install xinetd
Once NRPE has been installed, you need to set up an init system - typically this is xinetd.
Many linux distributions come with xinetd pre-installed.
CentOS/RHEL/Fedora:
Ubuntu/Debian:
Configure xinetd
At this point, we need a configuration that tells xinetd about NRPE. This configuration is included - change directory to the NRPE source to install it:
You should now have a config located at /etc/xinetd.d/nrpe - this file contains an “only_from” directive which specifies which ip addresses are allowed to talk to the daemon. It is a space separated list of ip addresses. Add your Nagios XI server's IP after the only_from setting:
Change:
To:
Where x.x.x.x equals the IP address of your Nagios server.
Finally, we need to add the NRPE port and service declaration in /etc/services:
Let's test NRPE/xinetd to make sure it starts up cleanly:
You should see the following output:
Downloading, Compiling, And Installing The Nagios Plugins
NRPE need plugins to operate properly. Before we dive into configuration, download and build the Nagios-plugins (visit Nagios-Plugins.org/downloads to find the latest version of the plugins and adjust the version number in the commands accordingly):
Prerequisites
Make sure that you have the following packages installed:
Code: Select all
gcc glibc glibc-common openssl-devel perl
Downloading the Source
On the remote host (client system), log in as the root user to download and extract the NRPE tarball:
Code: Select all
cd /tmp
wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
tar zxvf nrpe-2.15.tar.gz
Compile and Installation
To compile and install NRPE, run the following commands:
Code: Select all
useradd nagios
cd nrpe-2.15
./configure
make
make install
Copy the sample nrpe.cfg file to your remote hosts' NRPE config directory:
Code: Select all
mkdir /usr/local/nagios/etc
cp sample-config/nrpe.cfg /usr/local/nagios/etc
Install xinetd
Once NRPE has been installed, you need to set up an init system - typically this is xinetd.
Many linux distributions come with xinetd pre-installed.
CentOS/RHEL/Fedora:
Code: Select all
yum install xinetd
Code: Select all
apt-get install xinetd
Configure xinetd
At this point, we need a configuration that tells xinetd about NRPE. This configuration is included - change directory to the NRPE source to install it:
Code: Select all
cd /tmp/nrpe-2.15
make install-xinetd
Code: Select all
vi /etc/xinetd.d/nrpe
Code: Select all
only_from = 127.0.0.1
Code: Select all
only_from = 127.0.0.1 x.x.x.x
Finally, we need to add the NRPE port and service declaration in /etc/services:
Code: Select all
echo "nrpe 5666/tcp" >> /etc/services
Code: Select all
service xinetd start
cd /usr/local/nagios/libexec
./check_nrpe -H 127.0.0.1
If you get the NRPE version number (as shown above), NRPE and xinetd are installed and configured correctly.NRPE v2.15
Downloading, Compiling, And Installing The Nagios Plugins
NRPE need plugins to operate properly. Before we dive into configuration, download and build the Nagios-plugins (visit Nagios-Plugins.org/downloads to find the latest version of the plugins and adjust the version number in the commands accordingly):
Code: Select all
cd /tmp
wget https://www.nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz tar
zxvf nagios-plugins-2.0.3.tar.gz
cd /tmp/nagios-plugins-2.0.3
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install