Nagios - NRPE install

From wiki.kungfootek.net
Jump to: navigation, search

4.7.14 - Recent changes to NRPE / package management will require this page to be heavily revised soon.


Reference:

http://exchange.nagios.org/directory/Addons/Monitoring-Agents/NRPE--2D-Nagios-Remote-Plugin-Executor/details


Get the nrpe package.

wget http://downloads.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.14/nrpe-2.14.tar.gz?r=&ts=1363788540&use_mirror=hivelocity


Create the nagios user on the client.

adduser nagios


Centos: yum install openssl-devel xinetd ./configure && make all && make install-plugin && make install-daemon && make install-daemon-config && make install-xinetd

Ubuntu: apt-get install libssl-dev xinetd ./configure --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnu make all && make install-plugin && make install-daemon && make install-daemon-config && make install-xinetd


Edit 4 files:

/usr/local/nagios/etc/nrpe.cfg

allowed_hosts=127.0.0.1 <nagios_server>
server_address=127.0.0.1 <nagios_server>

/etc/hosts.allow

ALL:192.168.10.1


/etc/xinetd.d/nrpe

only_from       = <nagios_server> # ( If the Nagios server is on another subnet then this number must be the local gateway IP. )


/etc/services

nrpe            5666/tcp

restart xinit.d


For remote commands to be executed you need to have the plugins.

Download and compile Nagios Plugins

wget http://nagios-plugins.org/download/nagios-plugins-2.0.tar.gz

unpack the archive, change to the folder and issue:

./configure --with-nagios-user=nagios --with-nagios-group=nagios && make && make install