NRPE:Command 'check_uptime' not defined

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
gsivaa
Posts: 7
Joined: Wed Sep 21, 2016 1:00 am

NRPE:Command 'check_uptime' not defined

Post 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$
}
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NRPE:Command 'check_uptime' not defined

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
gsivaa
Posts: 7
Joined: Wed Sep 21, 2016 1:00 am

Re: NRPE:Command 'check_uptime' not defined

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NRPE:Command 'check_uptime' not defined

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
gsivaa
Posts: 7
Joined: Wed Sep 21, 2016 1:00 am

Re: NRPE:Command 'check_uptime' not defined

Post 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 
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: NRPE:Command 'check_uptime' not defined

Post by rkennedy »

After making changes, did you run service xinetd restart? This will help make sure your configurations are saving.
Former Nagios Employee
gsivaa
Posts: 7
Joined: Wed Sep 21, 2016 1:00 am

Re: NRPE:Command 'check_uptime' not defined

Post by gsivaa »

Hi,

Yes i have restarted the service and the same error message is occurring on all the servers i have configured...
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: NRPE:Command 'check_uptime' not defined

Post by rkennedy »

What is the output from this?

Code: Select all

netstat -nap | grep 5666
Former Nagios Employee
Locked