Page 1 of 2

need help with NRPE on two new server not working

Posted: Thu May 17, 2018 9:40 am
by benningtonr
None of the checks are working, we currently have 93 hosts with 800 service checks that work fine. but for some reason i cannot get these two hosts to work. Please let me know what tests i need to run in order to give you more information.

Thank you

Re: need help with NRPE on two new server not working

Posted: Thu May 17, 2018 9:45 am
by benningtonr
this is what i get for all checks

CHECK_NRPE: Socket timeout after 30 seconds.

Re: need help with NRPE on two new server not working

Posted: Thu May 17, 2018 9:53 am
by benningtonr
these boxes are VM's that were cloned with the nsclient already installed if that helps.

Re: need help with NRPE on two new server not working

Posted: Thu May 17, 2018 10:01 am
by benningtonr
Both of these servers are ubuntu 16.04

Re: need help with NRPE on two new server not working

Posted: Thu May 17, 2018 2:18 pm
by kyang
these boxes are VM's that were cloned with the nsclient already installed if that helps.
Wait, so you have two Ubuntu servers with NRPE installed.
this is what i get for all checks
CHECK_NRPE: Socket timeout after 30 seconds.
Are you running the nrpe daemon or xinetd?

Is the nrpe or xinetd service started on those Ubuntu servers?

Code: Select all

sudo systemctl status nrpe.service
sudo status nrpe
Any firewall issues on the Ubuntu servers for port 5666? Try an nmap:

Code: Select all

nmap ubuntuServerIP -p 5666

Re: need help with NRPE on two new server not working

Posted: Fri May 18, 2018 7:26 am
by benningtonr
I ran the commands,

sudo systemctl status nrpe.service
[sudo] password for ronb:
รข nrpe.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
sudo status nrpe
sudo: status: command not found
I am not a linux person but this tells me the client is not installed, would that be correct?

Re: need help with NRPE on two new server not working

Posted: Fri May 18, 2018 9:14 am
by benningtonr
Does this mean the port is being blocked?

PORT STATE SERVICE
5666/tcp filtered nrpe

Re: need help with NRPE on two new server not working

Posted: Fri May 18, 2018 9:44 am
by lmiltchev
these boxes are VM's that were cloned with the nsclient already installed if that helps.
Let's step back for a minute. You don't need to install NSClient++ in order to monitor Ubuntu servers via NRPE... Installing NRPE and Nagios plugins is what you need.

Can you describe HOW you installed NRPE on these two servers? Did you try installing NSClient++ for Linux, compiled NRPE from source, installed it via a repo, etc.? What guide/tutorial/documentation did you follow?

Run the following commands on the both Ubuntu servers from the command line and show the output:

Code: Select all

find / -name *nrpe*
netstat -atn | grep 5666

Re: need help with NRPE on two new server not working

Posted: Fri May 18, 2018 10:29 am
by benningtonr
The VM is a clone of one we had installed the client on previously. I did not build it, so i am unsure.


/etc/rc1.d/K01nagios-nrpe-server
/etc/rc4.d/S03nagios-nrpe-server
/etc/default/nagios-nrpe-server
/etc/rc0.d/K01nagios-nrpe-server
/etc/rc5.d/S03nagios-nrpe-server
/etc/init.d/nagios-nrpe-server
/etc/nagios/nrpe.d
/etc/nagios/nrpe.cfg
/etc/nagios/nrpe_local.cfg
/etc/rc2.d/S03nagios-nrpe-server
/etc/rc6.d/K01nagios-nrpe-server
/etc/rc3.d/S03nagios-nrpe-server
/var/lib/dpkg/info/nagios-nrpe-server.md5sums
/var/lib/dpkg/info/nagios-nrpe-server.list
/var/lib/dpkg/info/nagios-nrpe-server.postrm
/var/lib/dpkg/info/nagios-nrpe-server.preinst
/var/lib/dpkg/info/nagios-nrpe-server.conffiles
/var/lib/dpkg/info/nagios-nrpe-server.postinst
/var/lib/dpkg/info/nagios-nrpe-server.prerm
/var/lib/lxcfs/cgroup/memory/system.slice/nagios-nrpe-server.service
/var/lib/lxcfs/cgroup/pids/system.slice/nagios-nrpe-server.service
/var/lib/lxcfs/cgroup/blkio/system.slice/nagios-nrpe-server.service
/var/lib/lxcfs/cgroup/devices/system.slice/nagios-nrpe-server.service
/var/lib/lxcfs/cgroup/cpu,cpuacct/system.slice/nagios-nrpe-server.service
/var/lib/lxcfs/cgroup/name=systemd/system.slice/nagios-nrpe-server.service
/run/nagios/nrpe.pid
/run/systemd/generator.late/nagios-nrpe-server.service
/run/systemd/generator.late/graphical.target.wants/nagios-nrpe-server.service
/run/systemd/generator.late/multi-user.target.wants/nagios-nrpe-server.service
/sys/fs/cgroup/memory/system.slice/nagios-nrpe-server.service
/sys/fs/cgroup/pids/system.slice/nagios-nrpe-server.service
/sys/fs/cgroup/blkio/system.slice/nagios-nrpe-server.service
/sys/fs/cgroup/devices/system.slice/nagios-nrpe-server.service
/sys/fs/cgroup/cpu,cpuacct/system.slice/nagios-nrpe-server.service
/sys/fs/cgroup/systemd/system.slice/nagios-nrpe-server.service
/usr/sbin/nrpe
/usr/share/man/man8/nrpe.8.gz
/usr/share/augeas/lenses/dist/nrpe.aug
/usr/share/augeas/lenses/dist/tests/test_nrpe.aug
/usr/share/doc/nagios-nrpe-server



ronb@WHRO:~$ netstat -atn | grep 5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN
ronb@WHRO:~$

Re: need help with NRPE on two new server not working

Posted: Fri May 18, 2018 11:16 am
by lmiltchev
Make sure that the Nagios XI server's IP is added to the "allowed_hosts" directive in the "/etc/nagios/nrpe.cfg" file:

Code: Select all

allowed_hosts=127.0.0.1,x.x.x.x
Save, exit, and restart the "nagios-nrpe-server" service:

Code: Select all

systemtct restart nagios-nrpe-server.service
Test the connection by running the following commands from the command line on the Nagios XI server:

Code: Select all

nmap <ubuntuServerIP> -p 5666
/usr/local/nagios/libexec/check_nrpe -H <ubuntuServerIP>
Does this mean the port is being blocked?

PORT STATE SERVICE
5666/tcp filtered nrpe
It is possible that port 5666 is blocked by a firewall. This is what you should see after running the nmap command:
Starting Nmap 6.47 ( http://nmap.org ) at 2018-05-18 11:14 CDT
Nmap scan report for x.x.x.x
Host is up (0.00045s latency).
PORT STATE SERVICE
5666/tcp open nrpe