Page 1 of 1

i am stumped on CRITICAL FTP socket timeout

Posted: Sat Mar 15, 2014 10:52 am
by socalheel
nagios is telling me: CRITICAL - Socket timeout after 10 seconds

but when i do a manual check_ftp command, i get this: FTP OK - 0.010 second response time on port 21

the load average on the target server is not high at all in relation to how it normally runs.

any ideas?

Re: i am stumped on CRITICAL FTP socket timeout

Posted: Mon Mar 17, 2014 9:28 am
by slansing
Can we see the service and command definition for this check?

Re: i am stumped on CRITICAL FTP socket timeout

Posted: Mon Mar 17, 2014 11:28 am
by socalheel
services.cfg:

Code: Select all

define service {
        host_name       servername.serverdomain
        service_description     FTP
        initial_state   o
        is_volatile     0
        max_check_attempts      7
        normal_check_interval   2
        retry_interval  1
        first_notification_delay        0
        active_checks_enabled   1
        passive_checks_enabled  1
        check_period    24x7
        parallelize_check       1
        obsess_over_service     1
        check_freshness 1
        freshness_threshold     180
        event_handler_enabled   1
        process_perf_data       1
        retain_status_information       1
        retain_nonstatus_information    1
        notification_interval   4
        notification_period     24x7
        notifications_enabled   1
        action_url      /pnp4nagios/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$
        check_command   check_nrpe!check_ftp
        icon_image      plug_in.png
        display_name    FTP
        notification_options    w,u,c,r,f,s
        stalking_options        o,w,u,c
        contact_groups  Null Placeholder Group
        servicegroups   Internal Services
}

commands.cfg

Code: Select all

define command {
        command_name    check_ftp
        command_line    $USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$ -t 30
}

Re: i am stumped on CRITICAL FTP socket timeout

Posted: Mon Mar 17, 2014 11:32 am
by tmcdonald
Well the reason it is not working is because you have it set to use check_nrpe, not check_ftp. Also, did you put "servername.serverdomain" on purpose to hide the real host address, or is that what you actually have in your config?

Re: i am stumped on CRITICAL FTP socket timeout

Posted: Mon Mar 17, 2014 11:35 am
by socalheel
tmcdonald wrote:Well the reason it is not working is because you have it set to use check_nrpe, not check_ftp. Also, did you put "servername.serverdomain" on purpose to hide the real host address, or is that what you actually have in your config?
it was working just fine for months with that configuration set that way, and it's working with all the other web servers we are monitoring FTP with that configuration.

and, you are correct, servername.serverdomain is something i substituted for the real server/domain names.

Re: i am stumped on CRITICAL FTP socket timeout

Posted: Mon Mar 17, 2014 12:00 pm
by tmcdonald
It may have been working fine, but I think you misunderstand how NRPE fits in.

NRPE is used to execute commands on a remote server. When you have "check_nrpe!check_ftp" defined as the check command, it means you want the remote server to run check_ftp as opposed to Nagios running it, and then have the remote server send the results of the check back to Nagios. But from what you are saying, running check_ftp from the Nagios command line works (and this would make sense). However that is not the same as having NRPE run the same command on the remote server. Running check_ftp on the command line would be equivalent to having "check_ftp" as the check command on the service.

Do you really mean to use NRPE to run this check?

Re: i am stumped on CRITICAL FTP socket timeout

Posted: Mon Mar 17, 2014 1:38 pm
by socalheel
oh thank you so much for clarifying and explaining that. it makes perfect sense why the check_ftp command works but the nrpe check would send an alert.

as for do i really want nrpe to do the checks? i'm not sure ... all this was put in place before i started working here so i'll have to check with the team lead to get his input.

thank you again for your help ... it was very beneficial.

Re: i am stumped on CRITICAL FTP socket timeout

Posted: Mon Mar 17, 2014 1:46 pm
by tmcdonald
No problem. Let us know what you come up with. At my old job I inherited a Nagios installation so I know how confusing it can be at times!