Recently I had to set up a Nagios server to monitor all our Linux based VMs ( virtual machines, test environments ) and after setting up the server side I started to look after how to set up the remote client sides.
There are at least two “general”, so widely used solution for this, called NRPE and NSCA plugins. I chose the first one and started to check some install guides available in the wild. However, I faced many problems during installation, so I decided to share my adventures.
Found this and this as install guides. We use CentOS 6.6 and I had many different problems with these processes. First, NRPE 3.1.x is not available yet as rpm, so I can not use yum to install it. Second, when I started to go through the “hard” way to install (using make), I faced many problems like missing files…it is really strange if this guide works for many others.
Anyway, after a while I managed to hunt down every file I needed, so here is the guide how to set up NRPE client on a remote CentOS Linux node:
- create nagios user and nagios group, add the user to the group
- wget nagios plugins (you can find it on nagios side, version is always growing of course, example )
- wget nrpe ( example )
- tar xfv nagios plugins zip
- tar xfv nrpe zip
- yum install gcc glibc glibc-common openssl-devel -y
- cd nagios dir
- make install
- chown -R nagios:nagios /usr/local/nagios
- cd nrpe dir
- make all
- make install
- make install-init
- download nrpe service script, example link
- remove -n from line 30 if you want to use SSL
- upload the script to the client, into /etc/init.d folder and give proper rights to it
- create /usr/local/nagios/etc/nrpe.cfg on clients and put your remote commands into it
- service nrpe start
That’s it, with this procedure now everything works for me on many clients. I have automated the installation using Ansible and it takes a couple of mins to set up any remote hosts with NRPE.
Server side is a bit different story, maybe I summarize that as well in the next post.