A quick copy and paste installation helper for NRPE plugin for nagios.

This is really choppy but I used it to speed up some quick NRPE installs on a bunch of machines. Still requires extra steps, I’de like to see someone make this into a perl script that does everything for you. :)

Note to whomever uses this script: you may need to update the wget, tar, and cd commands to be the most up to date package. I did not automate this! You can find what you’re looking for here: http://www.nagios.org/download.

/usr/sbin/useradd nagios
passwd nagios
mkdir ~/nagios_downloads
cd ~/nagios_downloads
wget http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.13/nagios-plugins-1.4.13.tar.gz
wget http://downloads.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.12/nrpe-2.12.tar.gz
tar xzf nagios-plugins-1.4.13.tar.gz
cd nagios-plugins-1.4.13
./configure
make all
make install
chown nagios:nagios /usr/local/nagios
chown -R nagios:nagios /usr/local/nagios/libexec
yum install xinetd
cd ~/nagios_downloads
tar xzf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure --enable-command-args
make all
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd
service xinetd restart

My /etc/xinetd/nrpe file looks like the following. Notice I disabled SSL – this file shouldn’t be used if your website needs to be absolutely secure! You also need to modify the blame_nagios directive to be 1 on the nrpe.cfg file.

service nrpe
{
        flags           = REUSE
        socket_type     = stream    
        port            = 5666    
        wait            = no
        user            = nagios
        group           = nagios
        server          = /usr/local/nagios/bin/nrpe
        server_args     = -n -c /usr/local/nagios/etc/nrpe.cfg -i
        log_on_failure  += USERID
        disable         = no
        only_from       = 127.0.0.1
}

Now don’t forget to make this entry in your /etc/services file.

nrpe		5666/tcp

Additionally, you’ll need to open up the ports on the server so that NRPE and nagios can communicate!

This entry was posted in Nagios, Webhosting and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.