check_nrpe with check_cpu_stats always returns OK on Linux
check_nrpe with check_cpu_stats always returns OK on Linux
I see this issue in Nagios Xi , i am getting always OK for even high CPU utilization.
Re: check_nrpe with check_cpu_stats always returns OK on Lin
Can you show us the actual command run from the command line along with the output of it? Set the "warning" threshold lower than the "iowait" value to see if the status will change.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_nrpe with check_cpu_stats always returns OK on Lin
Thanks for your response.
COMMAND: /usr/local/nagios/libexec/check_nrpe -H <hostname of remote> -t 30 -c check_cpu_stats -a "-c 2 -w 1"
OUTPUT: CPU STATISTICS OK : user=1.75% system=0.75% iowait=0.00% idle=97.49% nice=0.00% steal=0.00% | CpuUser=1.75;CpuSystem=0.75;CpuIoWait=0.00;CpuIdle=97.49;CpuNice=0.00;CpuSteal=0.00;75;80
My intention is get CPU alerts if Linux server Total CPU Utilization ( w - 85% and C-90%) not just the IOWAIT%.
so if %idle is less than 15% then it should alert out Warning message and if %idle is less than 10% then it should alert critical message.
COMMAND: /usr/local/nagios/libexec/check_nrpe -H <hostname of remote> -t 30 -c check_cpu_stats -a "-c 2 -w 1"
OUTPUT: CPU STATISTICS OK : user=1.75% system=0.75% iowait=0.00% idle=97.49% nice=0.00% steal=0.00% | CpuUser=1.75;CpuSystem=0.75;CpuIoWait=0.00;CpuIdle=97.49;CpuNice=0.00;CpuSteal=0.00;75;80
My intention is get CPU alerts if Linux server Total CPU Utilization ( w - 85% and C-90%) not just the IOWAIT%.
so if %idle is less than 15% then it should alert out Warning message and if %idle is less than 10% then it should alert critical message.
Re: check_nrpe with check_cpu_stats always returns OK on Lin
In this case, you will need to use a different plugin as the "check_cpu_stats.sh" one is only reporting on iowait.
https://exchange.nagios.org/directory/P ... ts/details
I haven't tested it but it seems like it is what you are looking for. Give it a try and let us know if this resolved your problem.
I found the "check_linux" stats" plugin on the Nagios Exchange.[root@192 libexec]# /usr/local/nagios/libexec/check_cpu_stats.sh -h
check_cpu_stats.sh Revision 1.2 - CPU Utilization check script for Nagios
Usage: check_cpu_utilization.sh -w <warning value in % for iowait>
-w Warning level for cpu iowait
-h Show this page
Usage: check_cpu_stats.sh
Usage: check_cpu_stats.sh --help
Usage: check_cpu_stats.sh -w <warning>
Revision 1.2 (c) 2007 Steve Bosek ([email protected])
This plugin will check cpu utilization (user,system,iowait,idle in %)
-w is for reporting warning levels in percent of iowait
https://exchange.nagios.org/directory/P ... ts/details
I haven't tested it but it seems like it is what you are looking for. Give it a try and let us know if this resolved your problem.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_nrpe with check_cpu_stats always returns OK on Lin
OH Really, Thanks .
I ran this script on the server side and got below error.
# sh check_CPU_Linux.pl
check_CPU_Linux.pl: line 31: use: command not found
check_CPU_Linux.pl: line 32: use: command not found
check_CPU_Linux.pl: line 33: syntax error near unexpected token `('
check_CPU_Linux.pl: line 33: `use utils qw($TIMEOUT %ERRORS &print_revision &support);'
I ran this script on the server side and got below error.
# sh check_CPU_Linux.pl
check_CPU_Linux.pl: line 31: use: command not found
check_CPU_Linux.pl: line 32: use: command not found
check_CPU_Linux.pl: line 33: syntax error near unexpected token `('
check_CPU_Linux.pl: line 33: `use utils qw($TIMEOUT %ERRORS &print_revision &support);'
Re: check_nrpe with check_cpu_stats always returns OK on Lin
This is a perl script. Don't use "sh" to run it. Can you view the plugin's usage by running the following command?
Code: Select all
/path/to/your/plugin/check_CPU_Linux.pl -hBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_nrpe with check_cpu_stats always returns OK on Lin
I got below output
# ./check_CPU_Linux.pl -h
Can't locate Sys/Statistics/Linux.pm in @INC (@INC contains: /usr/local/nagios/libexec /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./check_CPU_Linux.pl line 35.
BEGIN failed--compilation aborted at ./check_CPU_Linux.pl line 35.
# ./check_CPU_Linux.pl -h
Can't locate Sys/Statistics/Linux.pm in @INC (@INC contains: /usr/local/nagios/libexec /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./check_CPU_Linux.pl line 35.
BEGIN failed--compilation aborted at ./check_CPU_Linux.pl line 35.
Re: check_nrpe with check_cpu_stats always returns OK on Lin
What distro/version is this? If RHEL/CENT, please run this command on the remote machine:
If nothing is returned, run this on the remote machine, and try it again:
What is the output of this command:
Code: Select all
rpm -qa | grep perl-Sys-Statistics-LinuxCode: Select all
yum install perl-Sys-Statistics-LinuxWhat is the output of this command:
Code: Select all
find / -name Linux.pmRe: check_nrpe with check_cpu_stats always returns OK on Lin
These are production servers, cant install required rpms. if possible can you suggest any other cpu monitoring plugins?
Re: check_nrpe with check_cpu_stats always returns OK on Lin
You may want to search the exchange site for a plugin that you do not have to install any modules, etc on your server.
https://exchange.nagios.org/
Most plugins require something to be installed.
https://exchange.nagios.org/
Most plugins require something to be installed.
Be sure to check out our Knowledgebase for helpful articles and solutions!