Unknown command(s) errors on all services, on just one host

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Unknown command(s) errors on all services, on just one host

Post by gormank »

If I run from the shell on the nagios or client hosts, it works fine, but in the Nagios web page it says unknown command. This and the others that don't work are working fine on many other clients configured in the same way by an automated process.

I've read the troubleshooting NRPE doc and checked what's there. Now I'm a bit baffled...

Got any ideas?

From the nagios server:
# su - nagios -c "/usr/local/nagios/libexec/check_nrpe -H qa4am2mlesg001 -u -t 45 -c check_cpuload2 -a '50 20'"
OK: CPU Load = 1.02% | CpuUser=0.71; CpuNice=0.14; CpuSystem=0.16; CpuIowait=0.00; CpuSteal=0.00; CpuIdle=98.98:20:10

On the client:
# grep check_cpuload2 /usr/local/nagios/etc/nrpe.cfg
command[check_cpuload2]=/usr/local/nagios/libexec/check_cpu_perf.sh $ARG1$

# file /usr/local/nagios/libexec/check_cpu_perf.sh
/usr/local/nagios/libexec/check_cpu_perf.sh: Bourne-Again shell script text executable

ll /usr/local/nagios/libexec/check_cpu_perf.sh
-rwxr-xr-x 1 nagios nagios 6557 Jun 18 2015 /usr/local/nagios/libexec/check_cpu_perf.sh

# su - nagios -c "/usr/local/nagios/libexec/check_cpu_perf.sh 20 10"
OK: CPU Load = 0.19% | CpuUser=0.11; CpuNice=0.00; CpuSystem=0.07; CpuIowait=0.00; CpuSteal=0.00; CpuIdle=99.81:20:10

# grep only_from /etc/xinetd.d/nrpe
only_from = 127.0.0.1 172.30.130.52 172.30.130.53

# service xinetd status
xinetd (pid 18019) is running...

# service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unknown command(s) errors on all services, on just one h

Post by lmiltchev »

Can you show us a screenshot of the error, and the actual config of the failing service (CCM->Services-><your service>->View Text Config)?
Be sure to check out our Knowledgebase for helpful articles and solutions!
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Unknown command(s) errors on all services, on just one h

Post by gormank »

As stated, the same service runs on >50 other hosts, so its somehow wrong on the client end.
# grep -v ^# services/CPU_Unix_Load.cfg

define service {
service_description CPU_Unix_Load
use 1VZW_default_service
hostgroup_name 1VZW_Linux_All,1VZW_Linux_Physical,1VZW_Linux_Virtual
display_name CPU Load
check_command check_nrpe!check_cpuload2!-a '50 20'!-a '50 20'!!!
_xiwizard linux-server
register 1
}

The green one is check_nrpe:
COMMAND: /usr/local/nagios/libexec/check_nrpe -H qa4am2mlesg001
OUTPUT: NRPE v2.15
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unknown command(s) errors on all services, on just one h

Post by lmiltchev »

The green one is check_nrpe:
COMMAND: /usr/local/nagios/libexec/check_nrpe -H qa4am2mlesg001
OUTPUT: NRPE v2.15
There is a mismatch between the output in the CLI and the output in the screenshot...

The following:

Code: Select all

I (0.4.3.143 2015-04-29) seem to be doing fine...
looks like a NSClient++ output... This is not a Windows server, is it?

Also, I am not sure why you are passing the arguments twice.
check_command check_nrpe!check_cpuload2!-a '50 20'!-a '50 20'
Be sure to check out our Knowledgebase for helpful articles and solutions!
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Unknown command(s) errors on all services, on just one h

Post by gormank »

Linux

# grep -v ^# services/CPU_Unix_Load.cfg

define service {
service_description CPU_Unix_Load
use 1VZW_default_service
hostgroup_name 1VZW_Linux_All,1VZW_Linux_Physical,1VZW_Linux_Virtual
display_name CPU Load
check_command check_nrpe!check_cpuload2!-a '50 20'!!!!!!
_xiwizard linux-server
register 1
}
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Unknown command(s) errors on all services, on just one h

Post by tgriep »

Can you check the permissions of the parent folders and see if they are correct?
/usr/local/nagios/libexec/
Do you see any errors in the log files on that server?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unknown command(s) errors on all services, on just one h

Post by lmiltchev »

Do you find any clues in the "/var/log/messages" on the remote box (client)? Can you run any other checks and pass arguments?

Example:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_users -a '-w 2 -c 5'
Be sure to check out our Knowledgebase for helpful articles and solutions!
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Unknown command(s) errors on all services, on just one h

Post by gormank »

Fixed... The clue about looking like the output was from nsclient finally sank in. The address was the same as a similarly named Windows box. On to the next machine that isn't installing nrpe and whining about FirewallD not running...

Close this anytime.

Thanks!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Unknown command(s) errors on all services, on just one h

Post by mcapra »

Closing this up
Former Nagios employee
https://www.mcapra.com/
Locked