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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-31-2009, 10:38 AM
|
#1
|
LQ Newbie
Registered: Feb 2009
Posts: 3
Rep:
|
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.
|
|
|
12-31-2009, 01:22 PM
|
#2
|
Senior Member
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137
Rep: 
|
Quote:
Originally Posted by jack.deselms
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?
|
|
|
12-31-2009, 01:27 PM
|
#3
|
LQ Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
|
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
|
|
|
01-04-2010, 12:13 PM
|
#4
|
LQ Newbie
Registered: Feb 2009
Posts: 3
Original Poster
Rep:
|
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.
|
|
|
01-05-2010, 02:39 AM
|
#5
|
Senior Member
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137
Rep: 
|
Quote:
Originally Posted by jack.deselms
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.
|
|
|
01-05-2010, 08:04 AM
|
#6
|
LQ Newbie
Registered: Feb 2009
Posts: 3
Original Poster
Rep:
|
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'.
|
|
|
01-05-2010, 08:12 AM
|
#7
|
Member
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 10:34 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|