Page 1 of 3

CPU usage just stopped working

Posted: Tue Sep 08, 2015 8:02 am
by steve.chambers
So a few days ago the CPU usage counter on one of my Win 2012 (r2 64 bit) just stopped working. It is one of five identical servers on the same (ESX 5.5) host. All of the other VMs are still happily chugging away and giving CPU usage stats and I verified that the command being sent is the same as on the other VMs:

Code: Select all

check_xi_service_nsclient!PASSWORD!CPULOAD!-l 5,80,90
The error I get is:

Code: Select all

NSClient - ERROR: Could not get data for 5 perhaps we don't collect data this far back?
Any ideas how to proceed?

Re: CPU usage just stopped working

Posted: Tue Sep 08, 2015 9:03 am
by hsmith
I found this article on the NSClient support forums. You are going to want to start by doing the steps outlined there.

Thanks.

Re: CPU usage just stopped working

Posted: Tue Sep 08, 2015 9:47 am
by steve.chambers
That forum post is vaguely unhelpful as it mentions something about a tool to rebuild counters and that there was more info in the FAQ. The problem there is I could not find an FAQ on that site.

I did eventually find someone who executed this command

Code: Select all

lodctr.exe /R
Which may or may not be the tool that was referred to but I just get an error:

Code: Select all

Error: Unable to rebuild performance counter setting from system backup store, error code is 5
Even if I run the command from an elevated prompt same error.

Re: CPU usage just stopped working

Posted: Tue Sep 08, 2015 11:02 am
by tgriep
Was the elevated account a local administrator account on the system?
What type of system are you trying to test?
What is the version on the NSClient++ that you are running?
Can you check the nsclient.log file for any errors?

Re: CPU usage just stopped working

Posted: Tue Sep 08, 2015 10:35 pm
by Box293

Re: CPU usage just stopped working

Posted: Wed Sep 09, 2015 8:15 am
by steve.chambers
The elevated CMD prompt was a local administrator. In fact I ran it again this morning, only this time using a lowercase "r" and the command executed correctly. Odd since it and the help for the command shows an uppercase R.

If I then run lodctr /q all services seem to be enabled and this is the result of nsclient++exe /test

Code: Select all

C:\Windows\system32>"C:\program files\nsclient++\nsclient++.exe" /test
Launching test mode - client mode
Service seems to be started, this is probably not a good idea...
d NSClient++.cpp(1216) Enabling debug mode...
d NSClient++.cpp(557) Attempting to start NSCLient++ - 0.3.9.328 2011-08-16
NSCore not loaded...
Archiving crash dumps in: C:\Users\steve.chambers\AppData\Local\NSClient++\crash dumps
d NSClient++.cpp(1007) Loading plugin: CheckDisk...
d NSClient++.cpp(1007) Loading plugin: Event log Checker....
d NSClient++.cpp(1007) Loading plugin: Helper function...
d NSClient++.cpp(1007) Loading plugin: CheckSystem...
d NSClient++.cpp(1007) Loading plugin: CheckWMI...
d \PDHCollector.cpp(73) Autodetected w2k or later, using w2k PDH counters.
d NSClient++.cpp(1007) Loading plugin: File logger...
d \PDHCollector.cpp(110) Using index to retrive counternames
l \FileLogger.cpp(87) Log path is: C:\program files\nsclient++\\nsclient.log
d NSClient++.cpp(1007) Loading plugin: NRPE server (w/ SSL)...
d \NRPEListener.cpp(92) Loading all commands (from NRPE)
e \NRPEListener.cpp(70) No scripts found in path: scripts\*.*
d \NRPEListener.cpp(122) Starting NRPE socket...
d NSClient++.cpp(1007) Loading plugin: NSClient server...
d NSClient++.cpp(709) NSCLient++ - 0.3.9.328 2011-08-16 Started!
l NSClient++.cpp(461) Using settings from: INI-file
l NSClient++.cpp(462) Enter command to inject or exit to terminate...
e \Socket.h(691) bind failed: 10048: Only one usage of each socket address (protocol/network addre
/port) is normally permitted.
e \Socket.h(722) Socket did not start properly, we will now do nothing...
e \Socket.h(691) bind failed: 10048: Only one usage of each socket address (protocol/network addre
/port) is normally permitted.
e \Socket.h(722) Socket did not start properly, we will now do nothing...
d \PDHCollector.cpp(130) Found countername: CPU:    \Processor(_total)\% Processor Time
d \PDHCollector.cpp(131) Found countername: UPTIME: \System\System Up Time
d \PDHCollector.cpp(132) Found countername: MCL:    \Memory\Commit Limit
d \PDHCollector.cpp(133) Found countername: MCB:    \Memory\Committed Bytes
The command seems to just stop there and a CTRL-C gets out of it...

This is a Windows 2012r2 VM running on ESX 5.5.

When I run nsclient++ /test I get this as a version string: 0.3.9.328 2011-08-16

and the nsclient log looks like this, I didn't see any obvious errors)

2015-09-09 08:05:10: message:modules\FileLogger\FileLogger.cpp:86: Starting to log for: NSClient++ - 0.3.9.328 2011-08-16
2015-09-09 08:05:11: message:CACHENSClient++.cpp:445: Booting: NSClientpp (Nagios) 0.3.9.328 2011-08-16 x64
2015-09-09 08:05:11: debug:CACHENSClient++.cpp:1216: Enabling debug mode...
2015-09-09 08:05:11: debug:CACHENSClient++.cpp:557: Attempting to start NSCLient++ - 0.3.9.328 2011-08-16
2015-09-09 08:05:11: debug:CACHENSClient++.cpp:1007: Loading plugin: CheckDisk...
2015-09-09 08:05:11: debug:CACHENSClient++.cpp:1007: Loading plugin: Event log Checker....
2015-09-09 08:05:11: debug:CACHENSClient++.cpp:1007: Loading plugin: Helper function...
2015-09-09 08:05:11: debug:CACHENSClient++.cpp:1007: Loading plugin: CheckSystem...
2015-09-09 08:05:11: debug:CACHENSClient++.cpp:1007: Loading plugin: CheckWMI...
2015-09-09 08:05:11: debug:CACHEmodules\CheckSystem\PDHCollector.cpp:73: Autodetected w2k or later, using w2k PDH counters.
2015-09-09 08:05:11: debug:CACHENSClient++.cpp:1007: Loading plugin: File logger...
2015-09-09 08:05:11: debug:CACHEmodules\CheckSystem\PDHCollector.cpp:110: Using index to retrive counternames
2015-09-09 08:05:11: message:CACHEmodules\FileLogger\FileLogger.cpp:87: Log path is: C:\program files\nsclient++\\nsclient.log
2015-09-09 08:05:11: debug:CACHENSClient++.cpp:1007: Loading plugin: NRPE server (w/ SSL)...
2015-09-09 08:05:11: debug:CACHEmodules\NRPEListener\NRPEListener.cpp:92: Loading all commands (from NRPE)
2015-09-09 08:05:11: error:CACHEmodules\NRPEListener\NRPEListener.cpp:70: No scripts found in path: scripts\*.*
2015-09-09 08:05:11: debug:CACHEmodules\NRPEListener\NRPEListener.cpp:122: Starting NRPE socket...
2015-09-09 08:05:11: debug:CACHENSClient++.cpp:1007: Loading plugin: NSClient server...
2015-09-09 08:05:11: debug:NSClient++.cpp:709: NSCLient++ - 0.3.9.328 2011-08-16 Started!
2015-09-09 08:05:11: message:NSClient++.cpp:461: Using settings from: INI-file
2015-09-09 08:05:11: message:NSClient++.cpp:462: Enter command to inject or exit to terminate...
2015-09-09 08:05:11: error:include\Socket.h:691: bind failed: 10048: Only one usage of each socket address (protocol/network address/port) is normally permitted.
2015-09-09 08:05:11: error:include\Socket.h:722: Socket did not start properly, we will now do nothing...
2015-09-09 08:05:11: error:include\Socket.h:691: bind failed: 10048: Only one usage of each socket address (protocol/network address/port) is normally permitted.
2015-09-09 08:05:11: error:include\Socket.h:722: Socket did not start properly, we will now do nothing...
2015-09-09 08:05:11: debug:modules\CheckSystem\PDHCollector.cpp:130: Found countername: CPU: \Processor(_total)\% Processor Time
2015-09-09 08:05:11: debug:modules\CheckSystem\PDHCollector.cpp:131: Found countername: UPTIME: \System\System Up Time
2015-09-09 08:05:11: debug:modules\CheckSystem\PDHCollector.cpp:132: Found countername: MCL: \Memory\Commit Limit
2015-09-09 08:05:11: debug:modules\CheckSystem\PDHCollector.cpp:133: Found countername: MCB: \Memory\Committed Bytes

Re: CPU usage just stopped working

Posted: Wed Sep 09, 2015 9:08 am
by tgriep
Can you upload your nsc.ini file so we can review it?

Re: CPU usage just stopped working

Posted: Thu Sep 10, 2015 10:32 am
by steve.chambers
Added nsc.ini file as requested, thx!

Re: CPU usage just stopped working

Posted: Thu Sep 10, 2015 10:48 am
by tgriep
Thanks for the file, nothing looks wrong in it.
Couple of things, Can you restart the NSClient service in the Windows system and see if that resolves the issue?
If that doesn't work, can you reboot the Windows host?

Re: CPU usage just stopped working

Posted: Thu Sep 10, 2015 12:38 pm
by steve.chambers
neither restarting the service nor the VM has any effect on the error message