Install and configure NRPE

There are several sources on Internet explain how to install and configure NRPE but non of them include an out of the box working solution. Various chmod etc things are missing thus giving you for free plenty of hours troubleshooting a simple HOWTO :)


Let's start...
Step 1 --> Download and install Nagios plugins
Download the latest nagios-plugins package direct from Nagios web site.
Example with wget:
On some Linux distributions (like Debian) the above mirror link might need to be renamed like:
mv nagios-plugins-1.4.15.tar.gz\?r\=http\ nagios-plugins-1.4.15.tar.gz
Extract the file and cd into the directory:
tar xzvf nagios-plugins-1.4.15.tar.gz
cd nagios-plugins-1.4.15
Create user nagios:
server1:/usr/local/src# useradd nagios
server1:/usr/local/src# passwd nagios
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Configure & install nagios plugins:
make install
Set permissions:
chown  -R nagios:nagios /usr/local/nagios
Step 2 --> Install and configure NRPE and Xinetd
yum install xinetd or apt-get install xinetd if you are on Debian
Edit /etc/services and add: nrpe 5666/tcp #NRPE
Download NRPE from nagios web site:
Example direct download using wget:
In some cases you might need to rename the file like:
mv nrpe-2.12.tar.gz\?r\=http\ nrpe-2.12.tar.gz
Extract, cd into the directory and install the package:
tar xzvf nrpe-2.12.tar.gz
cd nrpe-2.12
make all
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd
Edit /etc/xinetd.d/nrpe and replace with your server (where Nagios is running) IP.
Restart xinetd: service restart xinetd or /etc/init.d/xinetd restart if you are on Debian, Ubuntu etc.
Edit (create if missing and give nagios permissions) /usr/local/nagios/etc/nrpe.cfg and check that allowed_hosts line is something like:
where MyServerIP is the IP of your Nagios server.
Double check the check_disk command to suit your host installation:
command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/md1
In the above example we configured to check our root directory which is on software RAID and on 2nd partition.
All done, add some extra services on your host definitions and try out the NRPE in action.
Posted on: 17/10/2011

If you want to leave a comment please Login or Register