Hi all,
I have this config:
define service{
use generic-service
hostgroup_name stage_alfresco
service_description FTP
check_command check_nrpe!check_ftp_alfresco -a 2 4 1024
notifications_enabled 1
}
command[check_ftp_alfresco]=/usr/local/nagios/libexec/check_ftp -p 1024 -w $ARG1$ -c $ARG2$
Command exectutes fine: [root@stageutil03 libexec]# ./check_nrpe -H prodalf01 -c check_ftp_alfresco -a 2 4 1024
FTP OK - 0.001 second response time on port 1024 [220 FTP server ready]|time=0.000717s;2.000000;4.000000;0.000000;10.000000
But I get Connection refused for that host on Nagios UI
check_ftp works, Nagios shows Connection Refused
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_ftp works, Nagios shows Connection Refused
is stageutil03 the Nagios server, or the host NRPE is running on?
Re: check_ftp works, Nagios shows Connection Refused
stageutil03 is the Nagios server, prodalf01 is the NRPE
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_ftp works, Nagios shows Connection Refused
This is also going to depend on what you have for the command definition for check_nrpe, can you post that command definition?
Re: check_ftp works, Nagios shows Connection Refused
Here you go
# 'check_nrpe' command definition
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
# 'check_nrpe' command definition
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: check_ftp works, Nagios shows Connection Refused
You will need to set warning and critical values in either your service or command definition as see it shows you on the remote host's NRPE.cfg file definition.
In the service definition change it to the following for example:
These are the available options for use with the plugin:
Code: Select all
command[check_ftp_alfresco]=/usr/local/nagios/libexec/check_ftp -p 1024 -w $ARG1$ -c $ARG2$Code: Select all
check_command check_nrpe!check_ftp_alfresco -a "-w <value> -c <value>"
Code: Select all
[-w <warning time>] [-c <critical time>] [-s <send string>]
[-e <expect string>] [-q <quit string>][-m <maximum bytes>] [-d <delay>]
[-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j]
[-D <days to cert expiry>] [-S <use SSL>] [-E]
Re: check_ftp works, Nagios shows Connection Refused
I'm not quite sure I understand what you proposing. I already have it setup that way. NRPE
command[check_ftp_alfresco]=/usr/local/nagios/libexec/check_ftp -p 1024 -w $ARG1$ -c $ARG2$
on Nagios master:
check_command check_nrpe!check_ftp_alfresco -a 2 4 1024
command[check_ftp_alfresco]=/usr/local/nagios/libexec/check_ftp -p 1024 -w $ARG1$ -c $ARG2$
on Nagios master:
check_command check_nrpe!check_ftp_alfresco -a 2 4 1024
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: check_ftp works, Nagios shows Connection Refused
The difference between what you showed us is that on the remote host you have warning and critical arguments set up, however on the Nagios server's side this is not the case, so.. what you are trying to pass that plugin is getting bounced back because it is not valid, you must match the two command's.
Is not valid for what you are trying to connect to the NRPE plugin with as the command on the Remote server expects warning and critical values, not just a -a with a number string, it is asking for you to plug in what is located in the ARG1 and ARG2 fields of the plugin command.
Code: Select all
-a 2 4 1024