Running Nagios XI Linux Agent as init script, not xinetd

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
davehu
Posts: 4
Joined: Tue Apr 07, 2015 12:37 pm

Running Nagios XI Linux Agent as init script, not xinetd

Post by davehu »

Hi, by default the Nagios XI Linux Agent installer runs nrpe under xinetd. One problem with this is that the xinetd only_from setting does a reverse DNS lookup on the IP address and if that does not match then the connection will be refused. In my case I am running Nagios XI in AWS and so the IP address xinetd sees is the internal IP address of my Nagios server, and the reverse IP lookup returns the internal name of the server “ip-172-32-6-213.us-west-2.compute.internal”, so the only two values that work with xinetd are that hostname, or the internal IP of 172.32.6.213, both of which will change if the Nagios instance is terminated and relaunched, which would force updating nrpe configuration on all the monitored servers – not good.

I have found that when nrpe is run as an init script, that allowed_hosts in nrpe.cfg can be configured with a Route 53 hostname and it will work. In that case I can just update the IP address in Route 53 if the Nagios XI server IP address changes. So for me, nrpe run as an init script makes more sense.

My question is whether there are instructions on how to run the Nagios XI Linux Agent as an init script instead of under xinetd.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Running Nagios XI Linux Agent as init script, not xinetd

Post by abrist »

Well, just as any other init script based daemon. You can take a look at the init scripts in the linux-agent source by untaring the nrpe subcomponent and looking at the different init-script[-*]s:

Code: Select all

cd /tmp/linux-nrpe-agent/subcomponents/nrpe/
tar vfxz nrpe-2.15.tar.gz
./configure
cat init-scrip* | more
Just copy the desired one over to /etc/init.d, set the proper permissions and then start it with:

Code: Select all

/etc/init.d/nrpe start
Remember to check your firewall settings etc, as these things are normally handled by xinetd.
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.
Locked