Page 1 of 1

Nagios server not able to connect to Linux Servers

Posted: Sun Mar 20, 2016 11:25 pm
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

Re: Nagios server not able to connect to Linux Servers

Posted: Mon Mar 21, 2016 10:40 am
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?

Re: Nagios server not able to connect to Linux Servers

Posted: Mon Mar 21, 2016 10:46 am
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

Re: Nagios server not able to connect to Linux Servers

Posted: Tue Mar 22, 2016 1:54 am
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

Re: Nagios server not able to connect to Linux Servers

Posted: Tue Mar 22, 2016 9:25 am
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.

Re: Nagios server not able to connect to Linux Servers

Posted: Wed Mar 23, 2016 4:15 pm
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

Re: Nagios server not able to connect to Linux Servers

Posted: Wed Mar 23, 2016 9:37 pm
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.

Re: Nagios server not able to connect to Linux Servers

Posted: Thu Mar 24, 2016 9:16 am
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.

Re: Nagios server not able to connect to Linux Servers

Posted: Wed Apr 27, 2016 12:33 pm
by steelwedge
This issue has been resolved by enabling the SSL while adding the linux server in CCM configuration wizard.

Re: Nagios server not able to connect to Linux Servers

Posted: Wed Apr 27, 2016 12:37 pm
by bwallace
Glad to hear this is resolved and thanks for posting the solution. I'll close this one out now...