Skip to content

Instantly share code, notes, and snippets.

@krusynth
Created December 15, 2015 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krusynth/845308f4d9e9c3f90e5c to your computer and use it in GitHub Desktop.
Save krusynth/845308f4d9e9c3f90e5c to your computer and use it in GitHub Desktop.

Install NRPE and the necessary plugins.

CentOS/Fedora/RHEL

sudo yum install nrpe nagios-plugins nagios-plugins-all

Ubuntu/Debian

sudo apt-get install nagios-nrpe-server nagios-plugins

Note that recent versions of Ubuntu are compiled to not allow NRPE with arguments passed by the remote server. If that's a problem, follow the following instructions to install from source

Ubuntu/Debian from source

Taken from: https://assets.nagios.com/downloads/nagiosxi/docs/How-To-Configure-NRPE-and-Install-From-Source-with-Nagios-XI.pdf

Download our source packages:

apt-get source nagios-nrpe-server nagios-plugins

Install nagios/nrpe:

cd nagios-nrpe-2.15/

Configure to use passed arguments, and set the proper locations for ssl:

./configure --enable-command-args --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnu

Make and install:

make all sudo make install

Build our plugins:

cd ../nagios-plugins-1.5/
./configure
make all
sudo make install

If you tried the standard apt-get install method previously, you'll have a /etc/init.d/nagios-nrpe-server file already; you'll need to edit this file to set the new location for nrpe, which is this line:

DAEMON=/usr/local/nagios/bin/nrpe

If you are making a new installation, follow the xinetd instructions.

Tell NRPE to start up automatically.

RHEL flavors only, this is automatic on Debian:

sudo chkconfig --level 2345 nrpe on

Edit the NRPE Config file and set the following.

sudo vi /etc/nagios/nrpe.cfg

allowed_hosts=127.0.0.1,198.61.253.39,10.177.5.146
dont_blame_nrpe=1

(Re)Start NRPE.

RHEL

sudo service nrpe start

Debian

sudo /etc/init.d/nagios-nrpe-server restart

Create a nagios user in MySQL and give them a test database.

CREATE USER 'nagios'@'10.177.5.146' IDENTIFIED BY '{{PASSWORD}}';
CREATE DATABASE nagiostest;
GRANT ALL ON nagiostest.* to 'nagios'@'10.177.5.146';
FLUSH PRIVILEGES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment