NRPE Install Fails on Ubuntu 16.04

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: NRPE Install Fails on Ubuntu 16.04

Post by dwhitfield »

Please run the followin on ubuntu and provide output.

Code: Select all

iptables -A INPUT -p tcp -m tcp --dport 5666 -m state --state NEW,ESTABLISHED -j ACCEPT
nmap localhost -p 5666
netstat -l | grep 5666
/usr/local/nagios/libexec/check_nrpe -H localhost
cybergene
Posts: 92
Joined: Wed Aug 10, 2016 7:38 am
Location: Ottawa, Ontario, Canada

Re: NRPE Install Fails on Ubuntu 16.04

Post by cybergene »

dwhitfield wrote:Please run the followin on ubuntu and provide output.

Code: Select all

iptables -A INPUT -p tcp -m tcp --dport 5666 -m state --state NEW,ESTABLISHED -j ACCEPT
nmap localhost -p 5666
netstat -l | grep 5666
/usr/local/nagios/libexec/check_nrpe -H localhost

Here are the results:

Code: Select all

root@ip-:~# iptables -A INPUT -p tcp -m tcp --dport 5666 -m state --state NEW,ESTABLISHED -j ACCEPT

root@ip-:~# nmap localhost -p 5666

Starting Nmap 7.01 ( https://nmap.org ) at 2017-04-04 12:33 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000040s latency).
PORT     STATE  SERVICE
5666/tcp closed nrpe

Nmap done: 1 IP address (1 host up) scanned in 0.26 seconds

root@ip-:~# netstat -l | grep 5666

root@ip-:~# /usr/local/nagios/libexec/check_nrpe -H localhost
connect to address 127.0.0.1 port 5666: Connection refused
connect to host localhost port 5666: Connection refused
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: NRPE Install Fails on Ubuntu 16.04

Post by mcapra »

Can we see the full iptables ruleset? You can PM it if you have security concerns. This should provide it:

iptables -S

You could also try disabling iptables completely, running those commands again, then re-enabling iptables. Though I know nothing about this machine so i'm not sure if that's a completely good idea.

Do you have any additional services running on this Ubuntu machine that could be filtering in-bound tcp/udp traffic?
Former Nagios employee
https://www.mcapra.com/
cybergene
Posts: 92
Joined: Wed Aug 10, 2016 7:38 am
Location: Ottawa, Ontario, Canada

Re: NRPE Install Fails on Ubuntu 16.04

Post by cybergene »

No, I don't have any services filtering tcp ports. I made sure I have 5666 open for NRPE.


See PM for Iptables

Mod Edit: Output received and shared with techs.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: NRPE Install Fails on Ubuntu 16.04

Post by dwhitfield »

I set up an AWS account to test this. Are you using "Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ami-a58d0dc5" from the marketplace, something else from the marketplace, or something you built from scratch? Thanks!
cybergene
Posts: 92
Joined: Wed Aug 10, 2016 7:38 am
Location: Ottawa, Ontario, Canada

Re: NRPE Install Fails on Ubuntu 16.04

Post by cybergene »

dwhitfield wrote:I set up an AWS account to test this. Are you using "Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ami-a58d0dc5" from the marketplace, something else from the marketplace, or something you built from scratch? Thanks!
It the "Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ami-f4cc1de2".
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE Install Fails on Ubuntu 16.04

Post by tgriep »

It looks like the NRPE Agent is not running on that system so lets run is manually in daemon mode by running the following.

Code: Select all

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
Then to test it, run this and see if it responds with the version number of the agent.

Code: Select all

 /usr/local/nagios/libexec/check_nrpe -H localhost
Be sure to check out our Knowledgebase for helpful articles and solutions!
cybergene
Posts: 92
Joined: Wed Aug 10, 2016 7:38 am
Location: Ottawa, Ontario, Canada

Re: NRPE Install Fails on Ubuntu 16.04

Post by cybergene »

tgriep wrote:It looks like the NRPE Agent is not running on that system so lets run is manually in daemon mode by running the following.

Code: Select all

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
Then to test it, run this and see if it responds with the version number of the agent.

Code: Select all

 /usr/local/nagios/libexec/check_nrpe -H localhost
That fixed for Ubuntu 16.04 too.

This thread can be closed. Thanks again!
Locked