LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-31-2009, 10:38 AM   #1
jack.deselms
LQ Newbie
 
Registered: Feb 2009
Posts: 3

Rep: Reputation: 0
Question Nagios - Connection Refused by host


Environment:
- Nagios server (installtest) monitoring itself and one other server (bigpenguin)
- using NRPE

Known conditions:
- bigpenguin responding to request for root disk space
- installtest getting message 'Connection refused by host'
- bigpenguin responding to sql2db.pl plugin (using check_nrpe)
- installtest responding to sql2db.pl plugin (using check_nrpe)

Thank you for your time.
 
Old 12-31-2009, 01:22 PM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by jack.deselms View Post
Environment:
- Nagios server (installtest) monitoring itself and one other server (bigpenguin)
- using NRPE

Known conditions:
- bigpenguin responding to request for root disk space
- installtest getting message 'Connection refused by host'
- bigpenguin responding to sql2db.pl plugin (using check_nrpe)
- installtest responding to sql2db.pl plugin (using check_nrpe)

Thank you for your time.


im confused..
which check is giving 'connection refused by host'? what is the check for?
 
Old 12-31-2009, 01:27 PM   #3
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello and welcome to LinuxQuestions,

Instead of the 'cryptic' description you should have provided, like centosboy indicates, what command was being executed, what's in your syslog/messages in regards to the NRPE plugin, is your nrpe.cfg configured to accept connections from that server, are the permissions set correctly, have you tried running the command as the nagios user on the remote machine? All of the above would make it a lot easier for someone to reply and try to help solve your problem.

Kind regards,

Eric
 
Old 01-04-2010, 12:13 PM   #4
jack.deselms
LQ Newbie
 
Registered: Feb 2009
Posts: 3

Original Poster
Rep: Reputation: 0
This is a portable system for training Army officers on Command and Control. We pickup and go to the training site and the system is configured according to the current situation. We typically have two servers, the primary and backup. The backup server is used as the Nagios Server and it monitors both servers, many windows work stations, and printers. NRPE is used to monitor the hard drives and a home-grown plugin on both servers. NRPE is communicating correctly with the plugins on both the primary and the backup servers (Nagios Server). The only problem is getting NRPE to check disk space on the local machine.

What command was being executed?
Check_root = check_disk -w 20% -c 10% -p /
Check_root_nrpe = $USER1$/check-nrpe -H 192.168.2.21 –c check_root

What is in your syslog/messages in regards to the NRPE plugin?
1. /var/log/nrpe_messages has no entries for ‘Connection Refused’
2. /var/log/nagios/nagios_debug has no entries for ‘Connection
Refused’
3. /var/log/nagios/nagios_log has
‘SERVICE NOTIFICATION: nagoisadmin;installtest;Root
Drive:CRITICAL;notify-service-by-email;
Connection refused by host’

Is your nrpe.cfg configured to accept connections from that server?
There are two servers being monitored:
1. primary: 192.168.2.2 – nrpe.cfg –
allowed_hosts=127.0.0.1,192.168.2.21
(Root Drive is reporting correctly)
2. nagiosserver: 192.168.2.21 – nrpe.cfg –
allowed_hosts=127.0.0.1,192.168.2.21
(Connection refused by host).
I know that 127.0.0.1 and 192.168.2.21 are redundant.

Are the permissions set correctly?
Which permissions are you referring to?

Have you tried running the command as the nagios user on the remote machine?
The problem is getting the local machine to report disk space.
The remote machine reports fine.
When I run 'check_disk' stand-alone, it reports the disk space
on the Nagios server correctly.
 
Old 01-05-2010, 02:39 AM   #5
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by jack.deselms View Post
This is a portable system for training Army officers on Command and Control. We pickup and go to the training site and the system is configured according to the current situation. We typically have two servers, the primary and backup. The backup server is used as the Nagios Server and it monitors both servers, many windows work stations, and printers. NRPE is used to monitor the hard drives and a home-grown plugin on both servers. NRPE is communicating correctly with the plugins on both the primary and the backup servers (Nagios Server). The only problem is getting NRPE to check disk space on the local machine.

What command was being executed?
Check_root = check_disk -w 20% -c 10% -p /
Check_root_nrpe = $USER1$/check-nrpe -H 192.168.2.21 –c check_root

What is in your syslog/messages in regards to the NRPE plugin?
1. /var/log/nrpe_messages has no entries for ‘Connection Refused’
2. /var/log/nagios/nagios_debug has no entries for ‘Connection
Refused’
3. /var/log/nagios/nagios_log has
‘SERVICE NOTIFICATION: nagoisadmin;installtest;Root
Drive:CRITICAL;notify-service-by-email;
Connection refused by host’

Is your nrpe.cfg configured to accept connections from that server?
There are two servers being monitored:
1. primary: 192.168.2.2 – nrpe.cfg –
allowed_hosts=127.0.0.1,192.168.2.21
(Root Drive is reporting correctly)
2. nagiosserver: 192.168.2.21 – nrpe.cfg –
allowed_hosts=127.0.0.1,192.168.2.21
(Connection refused by host).
I know that 127.0.0.1 and 192.168.2.21 are redundant.

Are the permissions set correctly?
Which permissions are you referring to?

Have you tried running the command as the nagios user on the remote machine?
The problem is getting the local machine to report disk space.
The remote machine reports fine.
When I run 'check_disk' stand-alone, it reports the disk space
on the Nagios server correctly.


I do not get why you are using nrpe for a local check.
It isnt needed for local checks. The main purpose of nrpe is for remote server checks hence the name (NRPE - Nagios Remote Plugin Executor.

Try doing local checks without NRPE.
Again this could be tested from the command line. You say when you run from the command line everything is fine...but you have to run it from the command line as nrpe would.
Anyway...try configuring nagios to do the check for anything local omitting nrpe.
 
Old 01-05-2010, 08:04 AM   #6
jack.deselms
LQ Newbie
 
Registered: Feb 2009
Posts: 3

Original Poster
Rep: Reputation: 0
The check works fine without NRPE. This is a road-show system that must be setup, configured, and running in a few hours - only to be torn down and moved to the next location, where the process is repeated. In all that we do, we must be consistent to reduce the configuration time.

I know that NRPE will work locally, my home-grown plugin is working fine. Please review the detailed explanation above and help me understand what will cause 'Connection refused by host'.
 
Old 01-05-2010, 08:12 AM   #7
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 44
Did you change the line in /etc/xinetd.d/nrpe from

disable = yes

to

disable = no



and also make sure this line in the same file has the IP address of the nagios server


only_from = 192.168.1.100*

*Change that to the IP of your nagios server.


restart xinetd if you make changes. This file has to be changed for every server you are connecting to from nagios.
 
  


Reply

Tags
linux



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
curl: (7) couldn't connect to host // wget --> failed: Connection refused. linea Linux - Newbie 12 05-21-2012 12:56 PM
Connection Refused or time out error in Nagios prak86 Linux - Newbie 1 12-30-2009 04:11 AM
telnet: Unable to connect to remote host: Connection refused stuckz Fedora - Installation 2 06-19-2007 09:21 AM
NFS problem - connection refused from distant host Agrouf Linux - Networking 4 10-17-2005 02:24 PM
telnet: Unable to connect to remote host: Connection refused batham Linux - Networking 0 07-07-2003 05:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration