[Nagiosplug-help] Fail to telnet NRPE port (5666)

Guy Waugh gwaugh at scu.edu.au
Tue May 17 19:23:05 CEST 2005


eugene wrote:
> Nagios FAQ
> http://www.nagios.org/faqs/viewfaq.php?faq_id=261&expand=false&showdesc=false 
> 
> 
> I was thinking the cause of tcp wrapper, but actually i am running from 
> xined, should be any tcp wrapper

On my hosts (RHEL3), I had to allow connections to NRPE from the Nagios 
host in /etc/hosts.allow, so TCP wrappers do seem to affect access to 
xinetd services (at least on RHEL3).

> ------------------------------------------------------------------------------------------ 
> 
> I get this while telnet port 5666
> 
> Trying X.X.X.X...
> Connected to X.X.X.X.
> Escape character is '^]'.
> Connection closed by foreign host.

Looks good (I think)... how soon does the connection close after saying 
'Connected to ...'? If it is immediately, it may be something like TCP 
wrappers, or the 'only from ...' line in your /etc/xinetd.d/nrpe file.

> 
> I do this at my NRPE client, is it a proper way?
> 1) Create nrpe file > /etc/xinetd.d/nrpe
> 
>        # default: on
>        # description: NRPE
>        service nrpe
>        {
>                flags           = REUSE
>                socket_type     = stream
>                wait            = no
>                user            = nagios
>                server          = /usr/local/nagios/nrpe
>                server_args     = -c /usr/local/nagios/nrpe.cfg --inetd
>                log_on_failure  += USERID
>                disable         = no
>                only_from       = 192.168.10.50
>      }

Looks good - did you SIGHUP xinetd after adding this file into 
/etc/xinetd.d?

> 
> 2) set port 5666 > /etc/services
>    nrpe            5666/tcp                        # NRPE

Looks good...

> 
> 3) /usr/local/nagios/nrpe -c /usr/local/nagios/nrpe.cfg -i
> ------------------------------------------------------------------------------------------ 
> 
> I am using hard code from nrpe.cfg,
> command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 
> 30,25,20

Looks good, provided you are not using user-supplied arguments...

> 
> 
> Define in Nagios server
> 1) in checkcommands.cfg
> 
> define command{
>        command_name    check_nrpe
>        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
>        }

Looks good, provided once again that you are not using user-supplied args...

> 
> 2) # Service definition
> define service{
>        use                            generic-service
> 
>        host_name                      Testing
>        service_description            Check Load
>        is_volatile                    0
>        check_period                   24x7
>        max_check_attempts             3
>        normal_check_interval          3
>        retry_check_interval           1
>        contact_groups                 Support-Team
>        notification_interval          120
>        notification_period            24x7
>        notification_options           w,u,c,r
>        check_command                  check_nrpe!check_load
>        }

Looks good to me as well.

> 
> 
> ------------------------------------------------------------------------------------------ 
> 
> 
> What are the things i left? Is there any mismatch of configuration

Not that I can see...

Have you tried running the check_load command on the remote machine? 
Does it work?

If it does, what happens when you call the 'check_load' command on the 
remote machine using check_nrpe on the Nagios host? Does it work?

Regards,
Guy.

<snip>





More information about the Help mailing list