When trying to add Performance Counters an error is produced:
Invalid class errors are displayed in agent log files.
WMI or PerfMon counters cannot be displayed.
From the command line run
If either of these fail, this is an indication that lodctr should be run (below).
If counters can be seen in Performance Monitor running locally on the host, but not in Foglight, restart the Remote Registry Service
If counters cannot be seen in Performance Monitor running locally on the host, restart the Windows Management Instrumentation (WMI)and Performance Logs and Alerts services.
NOTE: The locctr /r commands does not have an effect on the system performance.
Confirm whether process performance counters are disabled. The value 0 in Disable Performance Counters registry key indicates that the process performance counters are enabled. Any other values indicate that the performance counters are disabled on the Windows system.
If this Registry Key is not present, then the Performance Counters are not disabled here at the registry level.
DISCLAIMER: Support does not provide support for problems that arise from improper modification of the registry. The Windows registry contains information critical to your computer and applications. Make sure you back up the registry before modifying it. For more information on the Windows Registry Editor and how to back up and restore it, refer to Microsoft Article ID 256986 “Description of the Microsoft Windows registry” at Microsoft Support.
Look at also this Microsoft article.