安装完NSClient++后nagios监控页面报错,查看NSClient++日志显示如下:
2021-02-23 14:10:13: message:modules\FileLogger\FileLogger.cpp:92: Starting to log for: NSClient++ - 0.3.8.76 2010-05-27
2021-02-23 14:18:15: debug:CACHENSClient++.cpp:551: Attempting to start NSCLient++ - 0.3.8.76 2010-05-27
2021-02-23 14:18:15: message:CACHEmodules\FileLogger\FileLogger.cpp:93: Log path is: C:\Program Files\NSClient++\\nsclient.log
2021-02-23 14:18:15: error:CACHEmodules\CheckSystem\PDHCollector.cpp:140: Failed to open performance counters: \(_total)\: PdhAddCounter failed: 在计算机上找不到指定的对象。 (C0000BB8)
2021-02-23 14:18:15: error:CACHEmodules\CheckSystem\PDHCollector.cpp:185: Failed to open performance counters: \Memory\Commit Limit: PdhAddCounter failed: 在计算机上找不到指定的对象。 (C0000BB8)
2021-02-23 14:18:15: error:CACHEmodules\CheckSystem\PDHCollector.cpp:219: No performance counters were found we will not wait for the end instead...
2021-02-23 14:18:15: error:modules\CheckSystem\PDHCollector.cpp:274: Failed to get CPU value
2021-02-23 14:20:15: error:modules\CheckSystem\PDHCollector.cpp:274: Failed to get CPU value
2021-02-23 14:20:24: error:modules\CheckSystem\PDHCollector.cpp:334: Failed to get MEM_CMT value: <UN ATTACHED>: No value has been collected yet
2021-02-23 14:22:15: error:modules\CheckSystem\PDHCollector.cpp:274: Failed to get CPU value
2021-02-23 14:22:24: error:modules\CheckSystem\PDHCollector.cpp:334: Failed to get MEM_CMT value: <UN ATTACHED>: No value has been collected yet
2021-02-23 14:24:24: error:modules\CheckSystem\PDHCollector.cpp:334: Failed to get MEM_CMT value: <UN ATTACHED>: No value has been collected yet
可在服务端执行命令检测:/usr/lib64/nagios/plugins/check_nt -H 192.168.88.140 -p 12489 -s xxx -v UPTIME
NSClient - ERROR: Could not get value
远程(cmd --> mstsc)登录后执行下列命令发现(红色部分显示countername 没找到,貌似语言字符集问题)
C:\NSClient++>nsclient++ /test
d \PDHCollector.cpp(123) Found countername: CPU: \????(_total)\????
d \NSClient++.cpp(773) Loading plugin: NRPE server...
d \PDHCollector.cpp(124) Found countername: UPTIME: \????\????
d \PDHCollector.cpp(125) Found countername: MCL: \????\????
d \PDHCollector.cpp(126) Found countername: MCB: \????\????
e \PDHCollector.cpp(133) Failed to open performance counters: \????(_total)\???
: PdhAddCounter failed: -1073738824: 在系统上找不到指定的对象。d \PDHCollector.cpp(169) We aparently failed to load counters trying to use def
ult (English) counters or those configured in nsc.ini
e \PDHCollector.cpp(178) Failed to open performance counters: \Memory\Commit Li
it: PdhAddCounter failed: -1073738824: The specified object is not found on the
system.e \PDHCollector.cpp(212) No performance counters were found we will not wait fo
the end instead...
d \NSClient++.cpp(773) Loading plugin: NSClient server...
e \Socket.h(645) bind failed: 10048: 通常每个套接字地址(协议/网络地址/端口)只允
许使用一次。d \NSClient++.cpp(773) Loading plugin: SystemTray...
执行下列命令解决
C:\Program Files\NSClient++>lodctr /R
信息: 成功地从系统备份存储中重建性能计数器设置
C:\Program Files\NSClient++>"nsclient++.exe" -stop
Stopping service.C:\Program Files\NSClient++>"nsclient++.exe" -start
Starting NSClientpp如果没有生效需要在服务中重启NSClien++服务