Page 1 of 1

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

Posted: Thu Jun 30, 2016 2:48 pm
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 ]

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

Posted: Thu Jun 30, 2016 3:02 pm
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)?

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

Posted: Thu Jun 30, 2016 3:10 pm
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

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

Posted: Thu Jun 30, 2016 3:44 pm
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'

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

Posted: Thu Jun 30, 2016 3:52 pm
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
}

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

Posted: Thu Jun 30, 2016 4:39 pm
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?

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

Posted: Thu Jun 30, 2016 4:43 pm
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'

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

Posted: Thu Jun 30, 2016 5:34 pm
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!

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

Posted: Tue Jul 05, 2016 9:12 am
by mcapra
Closing this up