LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Nagios - Connection Refused by host (https://www.linuxquestions.org/questions/linux-newbie-8/nagios-connection-refused-by-host-779085/)

jack.deselms 12-31-2009 10:38 AM

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.

centosboy 12-31-2009 01:22 PM

Quote:

Originally Posted by jack.deselms (Post 3810071)
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?

EricTRA 12-31-2009 01:27 PM

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

jack.deselms 01-04-2010 12:13 PM

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.

centosboy 01-05-2010 02:39 AM

Quote:

Originally Posted by jack.deselms (Post 3813758)
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.

jack.deselms 01-05-2010 08:04 AM

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'.

ncsuapex 01-05-2010 08:12 AM

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 11:12 PM.