This is all new to me but hey it's worth having a play
with so I've recorded what I've needed to do to get it working.
These steps were performed on a CentOS 6.5 server (minimal install).
NSClient++ RPMs were only available from 0.4.3 onwards.
Install EPEL Repository
NSClient++ requires some packages that are in the EPEL Repository.
- Type yum -y install epel-release and press Enter
- Wait while the component is downloaded and installed
Install NSClient++
- Type cd /tmp and press Enter
- Type wget https://github.com/mickem/nscp/releases/download/0.4.3.143/NSCP-0.4.3.143-1.el6.x86_64.rpm and press Enter
- Wait for the file to download
- Type yum -y install NSCP-0.4.3.143-1.el6.x86_64.rpm and press Enter
- Wait for NSClient++ to install
- Type iptables -I INPUT -p tcp --destination-port 5666 -j ACCEPT and press Enter
- Type service iptables save and press Enter
At this point NSClient++ is:
- Installed but currently not running
- Installed in /usr/sbin
- The configuration file is /etc/nsclient/nsclient.ini but if you look you'll find it is relatively empty
Configure NSClient++
I'm
going to allow the entire 10.25.0.0/16 subnet to connect to NSClient++,
you could change the steps below to a specific IP Address
- Type nscp settings --activate-module NRPEServer --add-defaults and press Enter
- Type nscp settings --activate-module CheckSystemUnix --add-defaults and press Enter
- Type nscp settings --path /settings/default --key "allowed hosts" --set 127.0.0.1,10.25.0.0/16 and press Enter
- Type nscp settings --path /settings/NRPE/server --key "allow arguments" --set true and press Enter
- Type nscp settings --path /settings/NRPE/server --key "allow nasty characters" --set true and press Enter
- Type nscp settings --path /settings/NRPE/server --key insecure --set true and press Enter
Start NSClient++
- Type service nsclient start and press Enter
- We'll also configure it to boot at startup
- Type ln -s /etc/init.d/nsclient /etc/rc.d/rc2.d/S35nsclient and press Enter
- Type ln -s /etc/init.d/nsclient /etc/rc.d/rc3.d/S35nsclient and press Enter
- Type ln -s /etc/init.d/nsclient /etc/rc.d/rc4.d/S35nsclient and press Enter
- Type ln -s /etc/init.d/nsclient /etc/rc.d/rc5.d/S35nsclient and press Enter
Test NRPE Client / Agent
This
will test that NSClient++ is properly installed and
listening on port 5666.
The following command is executed on a Nagios
Core server and the computer running NSClient++ has the ip
address 192.168.142.132.
- Type /usr/local/nagios/libexec/check_nrpe -H 192.168.142.132 and press Enter
- You should receive a response like:
- I (0.4.3.143 2015-04-29) seem to be doing fine...
- This confirms that NSClient++ is working