Page 1 of 1

nagios client nrpe error

Posted: Fri Aug 24, 2018 8:23 am
by IBM SOA GIP
Hi,

I am getting some nagios client nrpe error
- DISK CRITICAL - 40% is not accessible: No such file or directory
- NRPE: Command 'check_cpu_stats' not defined

1. We have nrpe running under xinetd (not as standalone)
/etc/xinetd.d/nrpe

Code: Select all

# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
        flags           = REUSE
        socket_type     = stream
        port            = 5666
        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       = xxx.xxx.xxx.xxx
}
2. When i restart xinetd, the config file /usr/local/nagios/etc/nrpe.cfg is not being picked but a different config file is being used.
/etc/nagios/nrpe.cfg

3. And in the syslog i see,
bind failed (Address already in use
Service nrpe failed to start and is deactivated
Aug 24 08:28:16 mlitoriib2 xinetd[27391]: Exiting...
xinetd[27424]: bind failed (Address already in use (errno = 98)). service = nrpe
xinetd[27424]: Service nrpe failed to start and is deactivated.
xinetd[27424]: bind failed (Address already in use (errno = 98)). service = nrpe
xinetd[27424]: Service nrpe failed to start and is deactivated.
xinetd[27424]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in.
xinetd[27424]: Started working: 2 available services
4. I have checked the port 5666 is listening and xinetd is reserving that port
tcp 0 0 :::5666 :::* LISTEN 27424/xinetd
5. I also could telnet to that nagios client on port 5666 and its connecting.

Could you please help me find where is the config error.

Thanks in advance...!

Re: nagios client nrpe error

Posted: Fri Aug 24, 2018 1:11 pm
by scottwilkerson
My guess is you have a nrpe service as well as the xinetd service

can you run

Code: Select all

service nrpe stop
service xinetd restart
If this returns things to normal, I would suggest running the following to disable the nrpe service on reboot

Code: Select all

chkconfig nrpe off

Re: nagios client nrpe error

Posted: Fri Aug 24, 2018 1:28 pm
by cdienger
There's a lot here, but the bind error may be the root of it some of it. If you stop the xinetd service, can you see if 5666 is still in use? Do yo you see a xinetd.pid(likely at /var/run/xinetd.pid)?

ll /var/run/xinetd.pid
service xinetd stop
ps aux | grep xinetd
netstat -nap | grep 5666
ll /var/run/xinetd.pid


Restart xinetd once it's confirmed to have been stopped and the pid file removed.

Is there a disk check or check_cpu_stats defined in either of the nrpe.cfg? Does the error regarding check_cpu_stats go away if you define a command in the /etc/nagios/nrpe.cfg ? For example, make sure an entry like this is there and isn't commented out:

command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats.sh $ARG1$

What are the full commands you're using to run the disk and cpu checks?