Nagios NSclient Failed to get CPU value: \238(_total)\6: Failed to get mutex :(

一台Windows Server 2012的nsclient出现以下的错误,表示无法获得CPU信息

2016-08-08 10:31:33: e:..\..\..\..\trunk\modules\CheckSystem\PDHCollector.cpp:223: Failed to get CPU value: \238(_total)\6: Failed to get mutex :(

从而造成大量的报警,在本地执行nrpe,返回的结果如下。

C:\Program Files\NSClient++>nscp nrpe -H 127.0.0.1 -c check_server_cpu_load
ERROR: Could not get data for 5m please check log for details

使用sys命令可以得到CPU的信息。

C:\Program Files\NSClient++>nscp sys --version
NSClient++, version: 0,4,1,102 2013-07-15, Platform: x64 C:\Program Files\NSClient++>nscp sys --validate
Listing configured counters
---------------------------
cpu = \238(_total)\6: ok-rate(0)
memory commit bytes = \4\26: ok(3.88834e+009)
memory commit limit = \4\30: ok(5.03005e+009)
uptime = \2\674: ok(3.54579e+006)
---------------------------
Listed 4 of 4 counters.

解决方案:

  1. 首先查看可以获取的所有系统计数值,数量较多,建议先放到文件。
nscp sys --list --all > a.txt
  1. 搜索Processor相关信息。
\Processor Information(_Total)\Performance Limit Flags
\Processor Information(_Total)\% Performance Limit
\Processor Information(_Total)\% Privileged Utility
\Processor Information(_Total)\% Processor Utility
\Processor Information(_Total)\% Processor Performance
\Processor Information(_Total)\Idle Break Events/sec
\Processor Information(_Total)\Average Idle Time
\Processor Information(_Total)\Clock Interrupts/sec
\Processor Information(_Total)\Processor State Flags
\Processor Information(_Total)\% of Maximum Frequency
\Processor Information(_Total)\Processor Frequency
\Processor Information(_Total)\Parking Status
\Processor Information(_Total)\% Priority Time
\Processor Information(_Total)\C3 Transitions/sec
\Processor Information(_Total)\C2 Transitions/sec
\Processor Information(_Total)\C1 Transitions/sec
\Processor Information(_Total)\% C3 Time
\Processor Information(_Total)\% C2 Time
\Processor Information(_Total)\% C1 Time
\Processor Information(_Total)\% Idle Time
\Processor Information(_Total)\DPC Rate
\Processor Information(_Total)\DPCs Queued/sec
\Processor Information(_Total)\% Interrupt Time
\Processor Information(_Total)\% DPC Time
\Processor Information(_Total)\Interrupts/sec
\Processor Information(_Total)\% Privileged Time
\Processor Information(_Total)\% User Time
\Processor Information(_Total)\% Processor Time
\Processor Information(0,_Total)\Performance Limit Flags
\Processor Information(0,_Total)\% Performance Limit
\Processor Information(0,_Total)\% Privileged Utility
\Processor Information(0,_Total)\% Processor Utility
\Processor Information(0,_Total)\% Processor Performance
\Processor Information(0,_Total)\Idle Break Events/sec
\Processor Information(0,_Total)\Average Idle Time
\Processor Information(0,_Total)\Clock Interrupts/sec
\Processor Information(0,_Total)\Processor State Flags
\Processor Information(0,_Total)\% of Maximum Frequency
\Processor Information(0,_Total)\Processor Frequency
\Processor Information(0,_Total)\Parking Status
\Processor Information(0,_Total)\% Priority Time
\Processor Information(0,_Total)\C3 Transitions/sec
\Processor Information(0,_Total)\C2 Transitions/sec
\Processor Information(0,_Total)\C1 Transitions/sec
\Processor Information(0,_Total)\% C3 Time
\Processor Information(0,_Total)\% C2 Time
\Processor Information(0,_Total)\% C1 Time
\Processor Information(0,_Total)\% Idle Time
\Processor Information(0,_Total)\DPC Rate
\Processor Information(0,_Total)\DPCs Queued/sec
\Processor Information(0,_Total)\% Interrupt Time
\Processor Information(0,_Total)\% DPC Time
\Processor Information(0,_Total)\Interrupts/sec
\Processor Information(0,_Total)\% Privileged Time
\Processor Information(0,_Total)\% User Time
\Processor Information(0,_Total)\% Processor Time
\Processor Information(0,15)\Performance Limit Flags
\Processor Information(0,15)\% Performance Limit
...
  1. 在nsclient.ini中指定cpu使用的计数器
[/settings/system/windows/pdh]
cpu=\Processor Information(_Total)\% Processor Time
  1. 再检测,正常获取CPU信息。
C:\Program Files\NSClient++>nscp nrpe -H 127.0.0.1 -c check_server_cpu_load
OK CPU Load ok.|'5m'=1%;90;95
上一篇:C# - 接口的继承


下一篇:JS动画之缓动函数分析及动画库