nagios监控通过NSClient++监控windows主机服务报错问题

博客内容讲述了在配置Nagios监控Windows主机时,通过NSClient++遇到的性能计数器错误。错误日志显示无法打开性能计数器,可能是由于语言字符集问题导致。解决方案包括执行lodctr/R命令重建性能计数器设置,以及重启NSClient++服务。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

nagios监控通过NSClient++监控windows主机服务报错问题

安装完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++服务

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值