Linux - NewbieThis 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.
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.
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)
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?
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.
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.
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.
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'.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.