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 ]
Unknown command(s) errors on all services, on just one host
Re: Unknown command(s) errors on all services, on just one h
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!
Re: Unknown command(s) errors on all services, on just one h
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
Code: Select all
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.
Re: Unknown command(s) errors on all services, on just one h
There is a mismatch between the output in the CLI and the output in the screenshot...The green one is check_nrpe:
COMMAND: /usr/local/nagios/libexec/check_nrpe -H qa4am2mlesg001
OUTPUT: NRPE v2.15
The following:
Code: Select all
I (0.4.3.143 2015-04-29) seem to be doing fine...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!
Re: Unknown command(s) errors on all services, on just one h
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
}
# 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
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?
/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!
Re: Unknown command(s) errors on all services, on just one h
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:
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!
Re: Unknown command(s) errors on all services, on just one h
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!
Close this anytime.
Thanks!
Re: Unknown command(s) errors on all services, on just one h
Closing this up
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/