CHECK_FTP returns "Connection refused"

Bret Goodfellow Bret.Goodfellow at questar.com
Thu Jan 11 20:06:15 CET 2007


I set up a separate command as you said, but I took out the "echo", and
the command executed as expected with the response coming back as:

FTP OK - 0.0003 second response time on port 21 .......

Here are my config files:

Checkcommands.cfg
# 'check_ftp' command definition
define command{
	command_name	check_ftp
	command_line	$USER1$/check_ftp -H $HOSTADDRESS$
	}

Hosts.cfg
########################################################################
##############
# 'dev01' host definition
#
########################################################################
##############
define host{
	use			generic-host		; Name of host
template to use

	host_name		dev01
	alias			dev01
	address			10.8.24.170
	check_command		check-host-alive
	contact_groups		linux-admins
	max_check_attempts	10
	notification_interval	480
	notification_period	24x7
	notification_options	d,u,r
	}

Services.cfg
# Service definition: check_ftp 
define service{
	use				generic-service		; Name
of service template to use
	host_name			dev01
	service_description		ftp
	is_volatile			0
	check_period			24x7
	max_check_attempts		3
	normal_check_interval		5
	retry_check_interval		1
	contact_groups			linux-admins
	notification_interval		1440
	notification_period		24x7
	notification_options		w,u,c,r
	check_command			check_ftp
	}
 
Other services for dev01 work ok, it's just check_ftp that doesn't work.

Thanks in advance,

Bret
-----Original Message-----
From: nagios-users-bounces at lists.sourceforge.net
[mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Marc
Powell
Sent: Thursday, January 11, 2007 10:59 AM
To: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] CHECK_FTP returns "Connection refused"



> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-

> bounces at lists.sourceforge.net] On Behalf Of Bret Goodfellow
> Sent: Thursday, January 11, 2007 11:47 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] CHECK_FTP returns "Connection refused"
> 
> I am running the check_ftp plugin against a server that is running
ftp.
> If I run the plugin from the command line (either as root or nagios),
the
> plugin appears to work, and gives me the following repsonse:
> 
> [root at dev02 plugins]# ./check_ftp -H dev01 FTP OK - 0.004 second 
> response time on port 21 [220 (vsFTPd 
> 2.0.1)]|time=0.003810s;0.000000;0.000000;0.000000;10.000000
> [root at dev02 plugins]#

Always run plugin tests as the nagios user. Tests as any other user are
not valid.
 
> But, when this plugin runs from Nagios, the browser display shows the 
> Service information to be: "Connection refused", and the nagios log
has
> the following entry:
> 
> [1168498800] CURRENT SERVICE STATE: dev01;ftp;CRITICAL;
HARD;3;Connection
> refused
> 
> Any ideas on this one?

Look at your host definition. The 'address' is most likely incorrect or
unresolve-able by the nagios user. Check to make sure that you're
testing the plugin in exactly the same way that it's run by nagios. You
can see what nagios is running by echoing your plugin command to a tmp
file like below. If you can't figure it out, please post the complete
host, service and command definitions.

define somecommand {
...
	command_line echo "$USER1$/check_ftp <other stuff here>" >>
/tmp/nagios-runs-me }

--
Marc

------------------------------------------------------------------------
-
Take Surveys. Earn Cash. Influence the Future of IT Join
SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when
reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list