nrpe error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

nrpe error

Post by benhank »

I just set up the linux nrpe clint and wizard on my server. Problem is I am getting the following error:

CHECK_NRPE: Error receiving data from daemon.
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: nrpe error

Post by scottwilkerson »

How did you install NRPE, there are multiple ways.

Did you follow the Linux agent guide,
http://library.nagios.com/library/produ ... inux-agent

or use another method?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: nrpe error

Post by benhank »

yes, I used that guide. I also copied and pasted the text into putty. How would I uninstall the agent and try again?
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: nrpe error

Post by lmiltchev »

You don't need to uninstall the agent - you can just reinstall it. Before you do this, see if you have xinetd installed:

Code: Select all

which xinetd
After you make sure it's installed, reinstall the linux agent following our documentation. Watch out for errors during the install process. Enter the Nagios server IP address towards the end of the installation process (when asked). Then test nrpe to make sure it works on the client site:

Code: Select all

cd /usr/local/nagios/libexec
(Modify this if your plugins directory is in a different location)

Code: Select all

./check_nrpe -H localhost
You should see:

Code: Select all

NRPE v2.12
Note: You may have to add your local host to the "only_from" line in the "/etc/xinetd.d/nrpe":

Code: Select all

only_from = 127.0.0.1 192.168.X.X
Things to watch for - iptables, port 5666.

Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: nrpe error

Post by benhank »

the arror i get after doing

Code: Select all

./check_nrpe -H localhost
is:
could not complete ssl handshake

Code: Select all

# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
       	flags           = REUSE
        socket_type     = stream    
	port		= 5666    
       	wait            = no
        user            = nagios
	group		= nagios
       	server          = /usr/local/nagios/bin/nrpe
        server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd
       	log_on_failure  += USERID
        disable         = no
	only_from	= k172.22.3.17
}
Here is what my nrpe cfg looks like:
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: nrpe error

Post by lmiltchev »

You have:

Code: Select all

only_from   = k172.22.3.17
You should probably have:

Code: Select all

only_from   = 172.22.3.17
Are you using xinetd? Can you run the following command?

Code: Select all

cat /etc/xinetd.d/nrpe
Either way, you should have also "127.0.0.1" in the "only_from" line, so that you can run NRPE against the localhost. Also, dont forget to restart the daemon if you make any changes:

Code: Select all

service xinetd restart
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: nrpe error

Post by benhank »

Scott what did you mean by this:
Things to watch for - iptables, port 5666.

Hope this helps.

User avatar
lmiltchev

Posts: 906
Joined: Mon May 23, 2011 1:15 pm
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: nrpe error

Post by benhank »

Now I am getting a "connection refused " error
I set this up with the wizard using SSL encryption , should I be adding a port or something?

this is what i ran on the client machine:

Code: Select all

Now I am getting a "connection refused " error
I set this up with  the wizard using SSL encryption , should I be adding a port or something?



[code]login as: root
[email protected]'s password:
Last login: Thu Jun  7 12:07:08 2012 from 172.22.240.3
[root@lkennagiosxi01 ~]# cd /usr/local/nagios/libexec
[root@lkennagiosxi01 libexec]# ./check_nrpe -H localhost
CHECK_NRPE: Error - Could not complete SSL handshake.
[root@lkennagiosxi01 libexec]# service xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]
You have new mail in /var/spool/mail/root
[root@lkennagiosxi01 libexec]# service xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]
[root@lkennagiosxi01 libexec]# service xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]


[root@lkennagiosxi01 libexec]# cd /usr/local/nagios/libexec
You have new mail in /var/spool/mail/root
[root@lkennagiosxi01 libexec]# ./check_nrpe -H localhost
CHECK_NRPE: Error - Could not complete SSL handshake.
[root@lkennagiosxi01 libexec]#
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: nrpe error

Post by lmiltchev »

Can you try telnetting to port 5666 from your nagios server?

Code: Select all

# telnet <your_client_IP> 5666
You can try temporarily disabling the firewall while you are troubleshooting by running in terminal:

Code: Select all

# service iptables stop
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: nrpe error

Post by benhank »

I ran this on the client server:

Code: Select all

login as: root
[email protected]'s password:
Last login: Thu Jun  7 13:39:47 2012 from 172.22.240.8
[root@lkennagiosxi01 ~]# service iptables stop
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: filter                    [  OK  ]
Unloading iptables modules:                                [  OK  ]
[root@lkennagiosxi01 ~]#
From the monitoring server:

Code: Select all

login as: root
[email protected]'s password:
Last login: Thu Jun  7 12:26:57 2012 from 172.22.240.3
[root@lkennagiosxi01 ~]# telnet 172.22.2.123 5666
Trying 172.22.2.123...
Connected to 172.22.2.123 (172.22.2.123).
Escape character is '^]'.
Connection closed by foreign host.
[root@lkennagiosxi01 ~]# telnet 172.22.2.123 5666
Trying 172.22.2.123...
Connected to 172.22.2.123 (172.22.2.123).
Escape character is '^]'.
Connection closed by foreign host.
You have new mail in /var/spool/mail/root
[root@lkennagiosxi01 ~]#



No good
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
Locked