Installing NRPE on FreePBX Distro

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Tim7473
Posts: 9
Joined: Thu Feb 11, 2016 8:26 pm

Installing NRPE on FreePBX Distro

Post by Tim7473 »

I'm just getting started with Nagios XI and I'm trying to install NRPE to monitor a FreePBX server. I'm getting an error on install that the OS version can't be determined. The FreePBX distro is based on CentOS, but it is reported as SHMZ release 6.6 (Final) instead of CentOS when I do cat /etc/redhat-release

Is there a way to get NRPE to successfully install?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Installing NRPE on FreePBX Distro

Post by rkennedy »

You should be able to compile it from source, see this link -
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

IIRC SHMZ is just a fork based for FreePBX.
Former Nagios Employee
Tim7473
Posts: 9
Joined: Thu Feb 11, 2016 8:26 pm

Re: Installing NRPE on FreePBX Distro

Post by Tim7473 »

I'm hitting an issue with SSL when I try to compile. Running ./configure gives me the error "checking for SSL headers... configure: error: Cannot find ssl headers"

When I try #which openssl I see it's installed at /usr/bin/openssl so I tried ./configure --with-ssl=/usr/bin/openssl and I'm still getting the error.

I haven't found many answers searching around. Any thoughts on getting past this?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Installing NRPE on FreePBX Distro

Post by rkennedy »

Do you have the package openssl-dev (might be openssl-devel)?
Former Nagios Employee
Tim7473
Posts: 9
Joined: Thu Feb 11, 2016 8:26 pm

Re: Installing NRPE on FreePBX Distro

Post by Tim7473 »

Installing OpenSSL-devel allowed me to compile and install, but now I'm getting the error "CHECK_NRPE: Error - Could not complete SSL handshake." when I try ./check_nrpe -H localhost. I'm also getting an error "connect to address <NAGIOS SERVER IP> port 5666: No route to host" when I try ./check_nrpe -H <NAGIOS SERVER IP>. I can ping the IP from this box though, so not sure if that's related. I also have NRPE running on another Ubuntu box, so I don't think there's an issue on the Nagios server.

I've gone through all the troubleshooting steps I could find for this error, including those in https://assets.nagios.com/downloads/nag ... utions.pdf

So far I've tried:

Making sure our Nagios server IP is in /usr/local/nagios/etc/nrpe.cfg
(Line from config: allowed_hosts=127.0.0.1,<NAGIOS SERVER IP>)

Making sure our Nagios server IP is in /etc/xinetd.d/nrpe and adding the per_source and instances lines
Lines from config file:
only_from = 127.0.0.1 <NAGIOS SERVER IP>
per_source = UNLIMITED
instances = UNLIMITED

Tried recompiling with --enable-ssl

Allowing port 5666 in IP tables just in case it was being blocked:
iptables -I INPUT -p tcp -m tcp --dport 5666 -j ACCEPT

No other firewalls are running one the box. I checked for CSF and APF.

Made sure the service was in /etc/services:
nrpe 5666/tcp
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Installing NRPE on FreePBX Distro

Post by rkennedy »

What happens if you run ./check_nrpe -H localhost -n? The -n will run it without SSL.

Please post the output.
Former Nagios Employee
Tim7473
Posts: 9
Joined: Thu Feb 11, 2016 8:26 pm

Re: Installing NRPE on FreePBX Distro

Post by Tim7473 »

# ./check_nrpe -H localhost -n
CHECK_NRPE: Error receiving data from daemon.

Trying to check and make sure it's running:
netstat -at | grep nrpe
tcp 0 0 *:nrpe *:* LISTEN

I'm not sure if the netstat output looks correct?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Installing NRPE on FreePBX Distro

Post by rkennedy »

From the Nagios machine, what is the result of a nmap freepbxserverip?

Also from the Nagios machine, what is the result of ./check_nrpe -H freepbxserverip -n?
Former Nagios Employee
Tim7473
Posts: 9
Joined: Thu Feb 11, 2016 8:26 pm

Re: Installing NRPE on FreePBX Distro

Post by Tim7473 »

Host is up (0.061s latency).
Not shown: 987 closed ports
PORT STATE SERVICE
22/tcp open ssh
53/tcp open domain
80/tcp open http
81/tcp open hosts2-ns
83/tcp open mit-ml-dev
84/tcp open ctf
85/tcp open mit-ml-dev
443/tcp open https
5222/tcp open xmpp-client
5269/tcp open xmpp-server
5280/tcp open xmpp-bosh
5666/tcp open nrpe
8088/tcp open radan-http

and

./check_nrpe -H <FREEPBXIP> -n
CHECK_NRPE: Error receiving data from daemon.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Installing NRPE on FreePBX Distro

Post by rkennedy »

Are you running NRPE under xinetd or standalone?

Code: Select all

ps -ef|grep nrpe
Also - after making changes to the config file, did you restart your service?
Former Nagios Employee
Locked