LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-29-2011, 07:29 PM   #1
sekreto
LQ Newbie
 
Registered: Jun 2011
Posts: 2

Rep: Reputation: Disabled
Exclamation check_log nrpe error: Connection refused by host


Please help me figure out what's wrong. Other nagios check for the same host is working except for this one.

In <hostname>.cfg of nagios server, I need to add this to check for a specific pattern in the host's log:

Quote:
define service{
use production-logs
host_name hostname
service_description Logs: pattern
flap_detection_enabled 0
max_check_attempts 1
check_interval 2
retry_interval 2
notification_options w,u,c
check_period hours
check_command check_log_nrpe!/home/dir/log/this.log!/tmp/this.log.seek!Log.pattern
}
i also added in nrpe.cfg of the host:
Quote:
command[check_log_nrpe]=/home/dir/nrpe/libexec/check_log -F $ARG1$ -O $ARG2$ -q $ARG3$
in commands.cfg:
Quote:
define command{
command_name check_log_nrpe
command_line $USER1$/check_nrpe -u -t 40 -H $HOSTADDRESS$ -c check_log_nrpe -a $ARG1$ $ARG2$ $ARG3$
}
However, when I restart nagios, I'm getting this error:
Quote:
[1309318233] SERVICE ALERT: MWOF01BK;Logs: Pattern ;CRITICAL;HARD;1;Connection refused by host
nrpe is configured to listen to port 5667
Quote:
[user@hostname ~]$ netstat -l | grep 5667
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 *:5667 *:* LISTEN 13768/nrpe

Last edited by sekreto; 06-29-2011 at 07:53 PM.
 
Old 06-30-2011, 03:56 PM   #2
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 537

Rep: Reputation: 79
Verify that the target host doesn't have a password setup in it config file or restrict the connection to certain host.

Try to nmap the target host from nagios server as well.

Best regards,
Angel.
 
Old 07-06-2011, 10:28 PM   #3
sekreto
LQ Newbie
 
Registered: Jun 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
define command{
command_name check_log_nrpe
command_line $USER1$/check_nrpe -u -t 40 -H $HOSTADDRESS$ -c check_log_nrpe -a $ARG1$ $ARG2$ $ARG3$
}
- this was the problem. the port was not defined... i added -p $PORT. now it is:

Quote:
define command{
command_name check_log_nrpe
command_line $USER1$/check_nrpe -u -t 40 -p $PORT-H $HOSTADDRESS$ -c check_log_nrpe -a $ARG1$ $ARG2$ $ARG3$
}
All's OK now.
 
Old 07-07-2011, 01:53 AM   #4
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 537

Rep: Reputation: 79
Thank you for your feedback.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Could not connect to host 127.0.0.1 - connection refused adrian2009 Slackware 1 12-07-2010 06:53 AM
Sendmail connection refused by host cloudno9 Linux - Newbie 2 01-14-2010 02:21 AM
Nagios - Connection Refused by host jack.deselms Linux - Newbie 6 01-05-2010 08:12 AM
telnet: Unable to connect to remote host: Connection refused stuckz Fedora 6 06-21-2007 02:36 AM
NFS problem - connection refused from distant host Agrouf Linux - Networking 4 10-17-2005 02:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:23 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration