NRPE 在 xinetd 下的问题

放在 xinet 下的服务,需要在 /etc/services 下写好对应的服务端口传输协议,尤其是修改了默认端口的情况下,以 nrpe 为例:
# tail /etc/services
nrpe                    11111/tcp                               # NRPE

否则启动服务的时候会出现如下类似的错误:
Jul  2 14:31:45 jaseywang xinetd[30992]: Service nrpe expects port 5666, not 11111
Jul  2 14:31:45 jaseywang xinetd[30992]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in.
Jul  2 14:31:45 jaseywang xinetd[30992]: Started working: 0 available services
Jul  2 14:35:09 jaseywang ntpdate[31027]: no server suitable for synchronization found
Jul  2 14:40:10 jaseywang ntpdate[31579]: no server suitable for synchronization found
Jul  2 14:43:59 jaseywang xinetd[30992]: Exiting…


另外需要在 xinetd.d/nrpe 允许某些 host 的连接,也就是 only_from 字段,注意防火墙:
# cat /etc/xinetd.d/nrpe
# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
        flags           = REUSE
        socket_type     = stream   
        port            = 11111
        wait            = no
        user            = nagios
        group           = nagios
        server          = /usr/local/nagios/bin/nrpe
        server_args     = -c /usr/local/nagios/etc/nrpe.cfg –inetd
        log_on_failure  += USERID
        disable         = no
        only_from       = 127.0.0.1 192.168.1.1
}

否则会出现如下的错误:
Encountering CHECK_NRPE: Error – Could not complete SSL handshake ..