ssh vs nrpe

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: ssh vs nrpe

Post by BanditBBS »

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?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: ssh vs nrpe

Post by jolson »

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.

Code: Select all

useradd nagios && passwd nagios
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.

Code: Select all

ps -ef | grep nrpe | grep -v grep
#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
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: ssh vs nrpe

Post by BanditBBS »

jolson - Really appreciate that in depth reply :)

Some of the servers won't have xinetd installed and since we are a hosting company, I really want to install as few items as possible on customer's machines. And since some won't have xinetd I'd just rather standardize for us as running as daemon. So I think my design as done and time to proceed with the install.

Leave this open and I'll update once I am done with my automation method for anyone else that may be interested.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: ssh vs nrpe

Post by abrist »

Great! As far as the age old nrpe vs. check_by_ssh discussion goes:
Image
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: ssh vs nrpe

Post by WillemDH »

Leave this open and I'll update once I am done with my automation method for anyone else that may be interested.
I'm most certainly interested how you are planning to do this. Go bandit.. :)
Nagios XI 5.8.1
https://outsideit.net
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: ssh vs nrpe

Post by abrist »

We shall indeed leave this open.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: ssh vs nrpe

Post by BanditBBS »

Hey WillemDH and whoever, linked is a web page of mine detailing how I did everything on my end. This is working awesomely!

Feel free to close this thread now if you'd like...people can PM me if they have questions :)

http://www.bandits-home-on-the-web.com/ ... date-nrpe/
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Locked