BanditBBS wrote:So here is another related question.....I sort of like the idea of not running nrpe under xinetd and using the daemon instead. What are the pros/cons to doing that? Anyone have a thought on that?
It really comes down to what xinetd provides, quoted from
http://linux.die.net/man/8/xinetd:
So far, the only reason for the existence of a super-server was to conserve system resources by avoiding to fork a lot of processes which might be dormant for most of their lifetime. While fulfilling this function, xinetd takes advantage of the idea of a super-server to provide features such as access control and logging.
If you are not concerned about the added functionality of xinetd, nrpe can be compiled very easily without it:
First, we need to install NRPE - I will use version 2.15.
I used the following guide as a point of reference:
http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf.
I will assume that NRPE is being compiled on Nagios 4.x.
1. Download the tarball and extract it in your /tmp directory.
Code: Select all
cd /tmp && wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz/download && tar xfz download && cd nrpe*
Setup the 'nagios' user.
2. Install NRPE pre-requisites.
Code: Select all
yum install -y mod_ssl openssl-devel gcc make openssl perl
3. Configure and make NRPE. This will create the /usr/local/nagios directory, which is where NRPE will be located.
Code: Select all
bash configure && make all && make install
4. Make the NRPE config directory, and setup the example config file.
Code: Select all
mkdir /usr/local/nagios/etc ; cp sample-config/nrpe.cfg /usr/local/nagios/etc/nrpe.cfg ; chown -R nagios:nagios /usr/local/nagios/etc
5. Open port 5666 in your firewall (if you intend on using NRPE for active checks). The rule below limits access to a particular source IP.
Code: Select all
iptables -A INPUT -s <nagiosserverip> -p tcp -m tcp --dport 5666 -m state --state NEW,ESTABLISHED -j ACCEPT && service iptables save
6. At this point, NRPE is ready to start.
Code: Select all
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
7. Ensure that NRPE is up and running.
#the output of this command should show one instance of NRPE running on the server.
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
Notes:
To have NRPE start on boot, consider adding an entry similar to the following to /etc/rc.local:
Code: Select all
echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d" >> /etc/rc.local
If you already have a working NRPE configuration, you can probably remove xinetd and follow steps 7-8:
Code: Select all
yum remove xinetd
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d