Page 1 of 1

NRPE:Command 'check_uptime' not defined

Posted: Wed Sep 21, 2016 2:19 am
by gsivaa
Hi Folks,

I am using nagios recently.. when i try to configure the nagios for the Linux client machines, i got up with the error message on the nagios window:
[*NRPE: Command 'check_uptime' not defined]

In the Nagios Monitoring server under the path /usr/local/nagios/etc/services.cfg

Code: Select all

define service{
use                          local-service
host_name               testserver
service_description   uptime
check_command       check_nrpe!check_uptime
notification_interval  30
notification_period    30
 

And under the /usr/local/nagios/etc/objects/command.cfg

Code: Select all

#check_uptime command definition
define command {
command_name     check_uptime
command_line        $USER$/check_uptime  -H $HOSTADDRESS$
}

Re: NRPE:Command 'check_uptime' not defined

Posted: Wed Sep 21, 2016 11:10 am
by lmiltchev
The "check_uptime" command must be defined on the client (remote machine that you want to monitor). For example, in the nrpe.cfg you may have something like this:

Code: Select all

command[check_uptime]=/usr/local/nagios/libexec/check_uptime
Then you call it by running the following command on the Nagios server:

Code: Select all

./check_nrpe -H <client ip> -c check_uptime

Re: NRPE:Command 'check_uptime' not defined

Posted: Thu Sep 22, 2016 1:31 am
by gsivaa
Hi

I have already input in the file /usr/local/nagios/etc/nrpe.cfg

Code: Select all

command[check_uptime]=/usr/local/nagios/libexec/check_uptime -w 3 -c 5
and restarted the xinetd service

then when I check in the nagios servers , i got the error message like below:

Code: Select all

./check_nrpe -H <client_ipaddr> -c check_uptime
NRPE: Command 'check_uptime' not defined

Re: NRPE:Command 'check_uptime' not defined

Posted: Thu Sep 22, 2016 10:20 am
by lmiltchev
Does NRPE run under xinetd on the client or as a "standalone" daemon?

What is the output of the following commands, run on the remote box?

Code: Select all

ps axuw | grep nrpe
netstat -at | grep nrpe
/usr/local/nagios/libexec/check_uptime -w 3 -c 5
find / -name nrpe
uname -a
cat /etc/*release

Re: NRPE:Command 'check_uptime' not defined

Posted: Fri Sep 23, 2016 1:39 am
by gsivaa

Code: Select all

[root@xxx libexec]# ps axuw |grep -i nrpe
root     19070  0.0  0.0 103320   852 pts/0    S+   14:35   0:00 grep -i nrpe

[root@xxx libexec]# netstat -at |grep nrpe
tcp        0      0 *:nrpe                      *:*                         LISTEN      

[root@xxx libexec]# /usr/local/nagios/libexec/check_uptime -w 3 -c 5
Uptime CRITICAL: 52 day(s) 23 hour(s) 36 minute(s) | uptime=76296.000000;3.000000;5.000000;

[root@xxx libexec]# find / -name nrpe
/etc/xinetd.d/nrpe
/root/nagios/nrpe-3.0.1/src/nrpe
/usr/local/nagios/bin/nrpe

[root@xxx libexec]# uname -a
Linux xxx 2.6.32-642.1.1.el6.x86_64 #1 SMP Fri May 6 14:54:05 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
[root@xxx libexec]# cat /etc/redhat-release 

Re: NRPE:Command 'check_uptime' not defined

Posted: Fri Sep 23, 2016 10:32 am
by rkennedy
After making changes, did you run service xinetd restart? This will help make sure your configurations are saving.

Re: NRPE:Command 'check_uptime' not defined

Posted: Fri Sep 23, 2016 11:08 pm
by gsivaa
Hi,

Yes i have restarted the service and the same error message is occurring on all the servers i have configured...

Re: NRPE:Command 'check_uptime' not defined

Posted: Mon Sep 26, 2016 11:11 am
by rkennedy
What is the output from this?

Code: Select all

netstat -nap | grep 5666