Errors:
- NSClient - ERROR: Could not get data for 5 perhaps we dont collect data this far back?
- NSClient - ERROR: Failed to get PDH value.
Solution:
Solution:
The above errors indicate that there could be issue with performance
counters.Also below screenshoted error could be seen while running “perfmon” command.
CASE1:
Steps:
We have to rebuild Performance Counters with LODCTR from an elevated command prompt.
Launch Command Prompt as Administrator (right click Runs As Administrator).
Drop into the C:\WINDOWS\System32 directory by typing CD\ then CD Windows\System32
To rebuild your resource counters type the following command:
lodctr /rThis will rebuild your counter values and may take a few moments so please be patient.
- If you wish to query the counters to make sure they were correctly set, use:
lodctr /qThis will give you something like the following:
Performance Counter ID Queries [PERFLIB]:
Base Index: 0x00000737 (1847)
Last Counter Text ID: 0x000031D2 (12754)
Last Help Text ID: 0x000031D3 (12755)
[.NET CLR Data] Performance Counters (Enabled)
DLL Name: %systemroot%\system32\netfxperf.dll
Open Procedure: OpenPerformanceData
Collect Procedure: CollectPerformanceData
Close Procedure: ClosePerformanceData
[.NET CLR Networking] Performance Counters (Enabled)
DLL Name: %systemroot%\system32\netfxperf.dll
Open Procedure: OpenPerformanceData
Collect Procedure: CollectPerformanceData
Close Procedure: ClosePerformanceData
* Now reopen the Performance Monitor and check it. You will see that the error was fixed.
CASE2:
Once you query the counters to make sure they were correctly set, use:lodctr /qYou may see that performance counter is disabled.
[PerfOS] Performance Counters (Disabled)System, which have the so called performance counters/objects disabled - which blocks CPUMon from reading the cpu usage. you have to manually re-enable those counters, from within registry.
DLL Name: %SystemRoot%\System32\perfos.dll
Open Procedure: OpenOSObject
Collect Procedure: CollectOSObjectData
Close Procedure: CloseOSObject
These are the changes that CPUMon will make to the registry:
HKLM\SYSTEM\CurrentControlSet\Services\PerfOS\Performance:Disable Performance Counters=0
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib:Disable Performance Counters=0