Edit the $ARG1$ and change
Code: Select all
check_cpu_stats.shCode: Select all
check_cpu_statsCode: Select all
check_cpu_stats.shCode: Select all
check_cpu_statsHi..tgriep wrote:You need to remove the .sh from the end of the command.
Edit the $ARG1$ and changetoCode: Select all
check_cpu_stats.shSave it out and apply the config and it should work for you.Code: Select all
check_cpu_stats
Code: Select all
command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats $ARG1$ $ARG2$Code: Select all
command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats.sh $ARG1$ $ARG2$I have both the files in the path,so it should have picked any of the files.tgriep wrote:You shouldn't have edited the command on the remote server.
Edit the common.cfg file and change it back fromtoCode: Select all
command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats $ARG1$ $ARG2$Save it and restart xinetdCode: Select all
command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats.sh $ARG1$ $ARG2$
Code: Select all
[root@speedking libexec]# ./check_cpu_stats.sh
CPU STATISTICS OK : user=0.50% system=0.50% iowait=0.00% idle=98.99% nice=0.00% steal=0.00% | CpuUser=0.50;CpuSystem=0.50;CpuIoWait=0.00;CpuIdle=98.99;CpuNice=0.00;CpuSteal=0.00;30;100Hi...lmiltchev wrote:It seems like this issue has been fixed in a newer version of the plugin. You can download the revision 2.1.1 from here:
https://exchange.nagios.org/directory/P ... ed/details
Example:
Let me know if this helped.Code: Select all
[root@speedking libexec]# ./check_cpu_stats.sh CPU STATISTICS OK : user=0.50% system=0.50% iowait=0.00% idle=98.99% nice=0.00% steal=0.00% | CpuUser=0.50;CpuSystem=0.50;CpuIoWait=0.00;CpuIdle=98.99;CpuNice=0.00;CpuSteal=0.00;30;100
This needs to be done through CCM, not directly against the flat config files (this is why is it not appearing in CCM)raamardhani7 wrote:Defined the same in Nagios XI server npre.cfg file:
grep check_cpu_stats nrpe.cfg
command[check_cpu_stats]=/usr/lib/nagios/plugins/check_cpu_stats $ARG1$
This should only be defined in one of the two files, not both.raamardhani7 wrote:Have defined the same in Nagios XI commands.cfg
grep check_cpu_stats commands.cfg
command_name check_cpu_stats
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_cpu_stats $ARG1$
Please execute this command at the command line of your Nagios XI server:raamardhani7 wrote:Have defined it in nrpe.cfg:
command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats $ARG1$
Have defined it in common.cfg
grep check_cpu_stats common.cfg
command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats $ARG1$
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H uusrcpmwik00 -t 30 -c check_cpu_stats Code: Select all
/usr/local/nagios/libexec/check_nrpe -H the_ip_address_of_uusrcpmwik00 -t 30 -c check_cpu_stats Box293 wrote:This is not necessary on the Nagios XI server.This needs to be done through CCM, not directly against the flat config files (this is why is it not appearing in CCM)raamardhani7 wrote:Defined the same in Nagios XI server npre.cfg file:
grep check_cpu_stats nrpe.cfg
command[check_cpu_stats]=/usr/lib/nagios/plugins/check_cpu_stats $ARG1$This should only be defined in one of the two files, not both.raamardhani7 wrote:Have defined the same in Nagios XI commands.cfg
grep check_cpu_stats commands.cfg
command_name check_cpu_stats
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_cpu_stats $ARG1$Please execute this command at the command line of your Nagios XI server:raamardhani7 wrote:Have defined it in nrpe.cfg:
command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats $ARG1$
Have defined it in common.cfg
grep check_cpu_stats common.cfg
command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats $ARG1$If you get the error OUTPUT: NRPE: Command 'check_cpu_stats' not defined can you please confirm that uusrcpmwik00 is the SAME server as the one that you defined the command in nrpe.cfg/common.cfg.Code: Select all
/usr/local/nagios/libexec/check_nrpe -H uusrcpmwik00 -t 30 -c check_cpu_stats
Try the test again but this time use the IP address of the server:Code: Select all
/usr/local/nagios/libexec/check_nrpe -H the_ip_address_of_uusrcpmwik00 -t 30 -c check_cpu_stats
Have deleted the contents from common.cfgBox293 wrote:This is not necessary on the Nagios XI server.raamardhani7 wrote:Defined the same in Nagios XI server npre.cfg file:
grep check_cpu_stats nrpe.cfg
Have defined it in CCM now, uploaded the screenshot for the same:
This needs to be done through CCM, not directly against the flat config files (this is why is it not appearing in CCM)raamardhani7 wrote:Have defined the same in Nagios XI commands.cfg
grep check_cpu_stats commands.cfg
command_name check_cpu_stats
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_cpu_stats $ARG1$
raamardhani7 wrote:Have defined it in nrpe.cfg:
command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats $ARG1$
Recycled xinetd service on both the servers, here is the output.. which is similar to the old![]()
[root@lussvpnagiosxi00 etc]# /usr/local/nagios/libexec/check_nrpe -H uusrcpmwik00 -t 30 -c check_cpu_stats
NRPE: Command 'check_cpu_stats' not defined
[root@lussvpnagiosxi00 etc]# /usr/local/nagios/libexec/check_nrpe -H 10.10.82.38 -t 30 -c check_cpu_stats
NRPE: Command 'check_cpu_stats' not defined
Basically the remote server is saying that it can't find the command defintion.raamardhani7 wrote:Recycled xinetd service on both the servers, here is the output.. which is similar to the old
[root@lussvpnagiosxi00 etc]# /usr/local/nagios/libexec/check_nrpe -H uusrcpmwik00 -t 30 -c check_cpu_stats
NRPE: Command 'check_cpu_stats' not defined
[root@lussvpnagiosxi00 etc]# /usr/local/nagios/libexec/check_nrpe -H 10.10.82.38 -t 30 -c check_cpu_stats
NRPE: Command 'check_cpu_stats' not defined
=======================Box293 wrote:Basically the remote server is saying that it can't find the command defintion.raamardhani7 wrote:Recycled xinetd service on both the servers, here is the output.. which is similar to the old
[root@lussvpnagiosxi00 etc]# /usr/local/nagios/libexec/check_nrpe -H uusrcpmwik00 -t 30 -c check_cpu_stats
NRPE: Command 'check_cpu_stats' not defined
[root@lussvpnagiosxi00 etc]# /usr/local/nagios/libexec/check_nrpe -H 10.10.82.38 -t 30 -c check_cpu_stats
NRPE: Command 'check_cpu_stats' not defined
Can you please upload the following files from the remote server uusrcpmwik00 here:
/usr/local/nagios/etc/nrpe/nrpe.cfg
/usr/local/nagios/etc/nrpe/common.cfg
/etc/xinetd.d/nrpe