Nagios server not able to connect to Linux Servers

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
steelwedge
Posts: 69
Joined: Fri Apr 24, 2015 4:58 am

Nagios server not able to connect to Linux Servers

Post by steelwedge »

Dear Team,

We have added our linux ubuntu server in Nagios XI monitoring by following the below documents, we are getting the following error message in the Nagios XI web interface.

OUTPUT: CHECK_NRPE: Error receiving data from daemon.


https://assets.nagios.com/downloads/nag ... _Agent.pdf

We tried the solutions in the below documents, it didn't helped. Please check and help us.

https://assets.nagios.com/downloads/nag ... utions.pdf

Regards,
Mohan
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios server not able to connect to Linux Servers

Post by rkennedy »

What is the check command for the service that is showing that output from NRPE?

Also, is that the result of a check, or are you running the 'test command' from the CCM?
Former Nagios Employee
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios server not able to connect to Linux Servers

Post by lmiltchev »

Can you show us the actual check that you are running from the command line, along with the output of it?

Example:

Code: Select all

[root@localhost tmp]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_users -a '-w 3 -c 5'
USERS OK - 2 users currently logged in |users=2;3;5;0
Also, run the following commands and show the output:

On the remote (Ubuntu) machine:

Code: Select all

uname -a
cat /etc/*release
ip addr | grep global | grep -m 1 'inet' | awk '/inet[^6]/{print substr($2,0)}' | sed 's|/.*||'
find / -name nrpe
On the Nagios XI box:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <client ip>
nmap <client ip> -p 5666
Be sure to check out our Knowledgebase for helpful articles and solutions!
steelwedge
Posts: 69
Joined: Fri Apr 24, 2015 4:58 am

Re: Nagios server not able to connect to Linux Servers

Post by steelwedge »

Please find below are the requested details.

Below are the commands output which we ran on remote linux server.

administrator@swtestviper03:~$ uname -a
Linux swtestviper03 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
administrator@swtestviper03:~$ cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"
NAME="Ubuntu"
VERSION="14.04.3 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.3 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

administrator@swtestviper03:~$ ip addr | grep global | grep -m 1 'inet' | awk '/inet[^6]/{print substr($2,0)}' | sed 's|/.*||'
10.7.1.182

Below are the commands output which we ran on Nagios Server.

[root@swnagios ~]# /usr/local/nagios/libexec/check_nrpe -H 10.7.1.182
NRPE v2.15
You have mail in /var/spool/mail/root
[root@swnagios ~]# nmap 10.7.1.182 -p 5666

Starting Nmap 6.47 ( http://nmap.org ) at 2016-03-21 20:34 PDT
Nmap scan report for swtestviper03.test.steelwedge.com (10.7.1.182)
Host is up (0.00074s latency).
PORT STATE SERVICE
5666/tcp open nrpe

Nmap done: 1 IP address (1 host up) scanned in 0.57 seconds
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios server not able to connect to Linux Servers

Post by lmiltchev »

The port 5666 is open, NRPE is running, and you can obtain the NRPE version number. So far, so good. What is the output of the command below?

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 10.7.1.182 -c check_users -a '-w 3 -c 5'
Can you show us the actual check that is failing, run from the command line, along with the output of it? Also, post the nrpe.cfg and common.cfg from the Ubuntu machine.
Be sure to check out our Knowledgebase for helpful articles and solutions!
spcmidrange
Posts: 47
Joined: Fri Jun 15, 2012 12:54 pm

Re: Nagios server not able to connect to Linux Servers

Post by spcmidrange »

I would also run them as the Nagios user to test. As root, everything works. But NRPE and the checks usually run as the nagios user
steelwedge
Posts: 69
Joined: Fri Apr 24, 2015 4:58 am

Re: Nagios server not able to connect to Linux Servers

Post by steelwedge »

what would be the password for nagios user as we didn't created that manually, as per the information in the document the nagios user will be created automatically when we run the ./fullinstall script.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios server not able to connect to Linux Servers

Post by lmiltchev »

Our script doesn't assign a password to the nagios user. It is entirely up to you if you want to set a password or not. Run the command from my previous post as root, and as nagios user, and show the output:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 192.168.3.30 -c check_users -a '-w 3 -c 5'
su -l nagios -c "/usr/local/nagios/libexec/check_nrpe -H 192.168.3.30 -c check_users -a '-w 3 -c 5'"
Post the nrpe.cfg and common.cfg from the Ubuntu machine on the forum.

Also, show us the actual check that is failing, run from the command line, along with the output of it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
steelwedge
Posts: 69
Joined: Fri Apr 24, 2015 4:58 am

Re: Nagios server not able to connect to Linux Servers

Post by steelwedge »

This issue has been resolved by enabling the SSL while adding the linux server in CCM configuration wizard.
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Nagios server not able to connect to Linux Servers

Post by bwallace »

Glad to hear this is resolved and thanks for posting the solution. I'll close this one out now...
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked