This is all new to me. From what I can gather so far the build process doesn't install a service in Ubuntu. But hey it's worth having a play with so I've recorded what I've needed to do to get it working.
Become Root
First you need to become root.
- Type sudo -i and press Enter
Install PrerequisitesThe following commands will install all the prerequisites for NSClient++. - Type sudo apt-get install -y git build-essential cmake python python-dev libssl-dev libboost-all-dev protobuf-compiler python-protobuf libprotobuf-dev rst2pdf python-sphinx libcrypto++-dev libcrypto++ liblua5.1-0-dev libgtest-dev and press Enter
- Wait while all of these components are installed
Clone NSClient++ From GitHub- Type cd /var/tmp and press Enter
- Type git clone --recursive https://github.com/mickem/nscp.git and press Enter
- Wait while all of these files are downloaded
Compile NSClient++
- Type mkdir build and press Enter
- Type cd build and press Enter
- Type cmake ../nscp and press Enter
- Type make and press Enter
- Wait while the make process happens ... it could easily take 20 minutes
- Type make test and press Enter
- Wait while the tests are performed
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 sudo mkdir /etc/nsclient and press Enter
- Type sudo ./nscp settings --activate-module NRPEServer --add-defaults and press Enter
- Type sudo ./nscp settings --activate-module CheckSystemUnix --add-defaults and press Enter
- Type sudo ./nscp settings --path /settings/default --key "allowed hosts" --set 10.25.0.0/16 and press Enter
- Type sudo ./nscp settings --path /settings/NRPE/server --key "allow arguments" --set true and press Enter
- Type sudo ./nscp settings --path /settings/NRPE/server --key "allow nasty characters" --set true and press Enter
- Type sudo ./nscp settings --path /settings/NRPE/server --key insecure --set true and press Enter
Start NSClient++- Type sudo ./nscp service --run --pid 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,65 2014-12-08) seem to be doing fine...
- This confirms that NSClient++ is working
- Some other checks you could perform:
- Type check_nrpe -H 192.168.142.132 -c check_uptime show-all and press Enter
- Type check_nrpe -H 192.168.142.132 -c check_memory show-all and press Enter
- Type check_nrpe -H 192.168.142.132 -c check_os_version show-all and press Enter
|