check_tcp works from CLI, not in nagios

Marc Powell marc at ena.com
Fri May 7 17:27:09 CEST 2004


Anthony Lieuallen <mailto:Anthony at PromoHut.com> wrote:
> Excerpts from services.cfg, checkcommands.cfg, the CLI, and the
> nagios page below. 
> I have numerous services (check_ dns, tcp, smtp, ping) all set up and
> working, except this particular tcp (_telnet) check fails, but works
> from the command line.  
> I'm stumped.
> 
> define service {
>         host_name               XXXHOSTNAMEHEREXXX
>         service_description     telnet
>         check_command           check_telnet
>         max_check_attempts      4
>         normal_check_interval   12
>         retry_check_interval    1
>         check_period            always
>         notification_interval   0
>         notification_period     always
>         notification_options    w,u,c,r
>         contact_groups          admin
> }
> 
> # 'check_telnet' command definition
> define command{
>         command_name    check_telnet
>         command_line    $USER1$/check_tcp -H $HOSTADDRESS$ -p 23
>         }
> 
> t-bone at 602744 [/usr/local/nagios/etc]# ../libexec/check_tcp -H
> XXXHOSTNAMEHEREXXX -p 23 
> TCP OK -   0.031 second response time on port 23|time=  0.031
> 
> Current Status:   CRITICAL  (Has been acknowledged)
> Status Information: Connection refused by host Current Attempt: 4/4
> State Type: HARD Last Check Type: ACTIVE 

You do know that Nagios isn't using the host_name but rather the
host_address as it appears in the host definition when executing the
service check, right? Have you tried using that and running check_tcp as
the nagios user as opposed to root? It seems to me that there is a
discrepency between those two addresses and the host_address doesn't
have anything listening on port 23.

--
MArc


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
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