|
| 1 | +# Icinga Knowledge Base - IWKB000016 |
| 2 | + |
| 3 | +## Short Message |
| 4 | + |
| 5 | +Checks using Performance Counter fail with various messages like `Exception of type 'System.OutOfMemoryException' was thrown` or `Icinga Invalid Configuration Error was thrown: PerfCounterCategoryMissing: Category "Memory" not found` |
| 6 | + |
| 7 | +## Example Exception |
| 8 | + |
| 9 | +### Out-Of-Memory Exception |
| 10 | + |
| 11 | +```powershell |
| 12 | +[UNKNOWN]: Icinga Unhandled Error was thrown: Unhandled Exception |
| 13 | +
|
| 14 | +Unhandled exception occurred: System.Management.Automation.MethodInvocationException: Exception calling "GetInstanceNames" with "0" argument(s): "Exception of type 'System.OutOfMemoryException' was thrown." ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at Microsoft.Win32.RegistryKey.InternalGetValue(String name, Object defaultValue, Boolean doNotExpand, Boolean checkSecurity) at Microsoft.Win32.RegistryKey.GetValue(String name) at System.Diagnostics.PerformanceMonitor.GetData(String item) at System.Diagnostics.PerformanceCounterLib.GetPerformanceData(String item) at System.Diagnostics.PerformanceCounterLib.get_CategoryTable() at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String category) at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category) at System.Diagnostics.PerformanceCounterCategory.GetCounterInstances(String categoryName, String machineName) at CallSite.Target(Closure , CallSite , Object ) --- End of inner exception stack trace --- at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) |
| 15 | +``` |
| 16 | + |
| 17 | +### Category "..." not found |
| 18 | + |
| 19 | +```powershell |
| 20 | +[UNKNOWN]: Icinga Invalid Configuration Error was thrown: PerfCounterCategoryMissing: Category "Memory" not found |
| 21 | +
|
| 22 | +The specified Performance Counter category was not found on this system. This could either be a configuration error on your local Windows machine or a wrong usage of the plugin. Please check on different Windows machines if this issue persis. In case it only occurs on certain machines it is likely that the counter is simply not present and the plugin can not be processed. |
| 23 | +``` |
| 24 | + |
| 25 | +## Reason |
| 26 | + |
| 27 | +This issue seem only to appear while running Icinga for Windows **without** [JEA-Profile](../130-JEA/01-JEA-Profiles.md) and installed SCOM-Agent from Microsoft including the `APM` feature on the same machine. |
| 28 | + |
| 29 | +The reason can be tracked back to the `Intercept Counters` which are installed together with SCOM and `APM` feature. |
| 30 | + |
| 31 | +To check if you are affected by these counters, you can run the command `Test-IcingaInterceptCounter` starting with Icinga for Windows v1.11.0: |
| 32 | + |
| 33 | +```powershell |
| 34 | +PS> Test-IcingaInterceptCounter; |
| 35 | +
|
| 36 | +[Notice]: Testing for Microsoft SCOM Intercept Counters |
| 37 | +[Failed]: Entry "HKLM:\SYSTEM\CurrentControlSet\Services\Intercept CSM Filters\Performance" is present on the system and the intercept counter is NOT disabled |
| 38 | +[Passed]: Entry "HKLM:\SYSTEM\CurrentControlSet\Services\Intercept Injector\Performance" is not present on the system |
| 39 | +[Passed]: Entry "HKLM:\SYSTEM\CurrentControlSet\Services\Intercept SyncAction Processing\Performance" is not present on the system |
| 40 | +[Passed]: Entry "HKLM:\SYSTEM\CurrentControlSet\Services\InterceptCountersManager\Performance" is not present on the system |
| 41 | +[Passed]: Entry "HKLM:\SYSTEM\CurrentControlSet\Services\Backup Exec\Performance" is not present on the system |
| 42 | +[Failed]: One or more intercept counters exist on this system which are not disabled. Please take a look at https://icinga.com/docs/icinga-for-windows/latest/doc/knowledgebase/IWKB000016/ for further details |
| 43 | +``` |
| 44 | + |
| 45 | +## Solution |
| 46 | + |
| 47 | +If the command `Test-IcingaInterceptCounter` is reporting a `Failed` state on any of the tests, they are most likely the cause for issues regarding Performance Counter monitoring. |
| 48 | + |
| 49 | +### Requiring APM Feature |
| 50 | + |
| 51 | +Please check beforehand, if you are making use of any of the `Intercept Counters` installed with the SCOM-Agent in your environment. If you are using and requiring the `APM` feature provided by SCOM, the solution would be to reinstall the SCOM-Agent together with the `APM` feature, which should resolve the issue. |
| 52 | + |
| 53 | +If the error persists after the reinstallation, please open a support case for SCOM with Microsoft. |
| 54 | + |
| 55 | +### APM is not required |
| 56 | + |
| 57 | +In case you are not using any of the `APM` features provided the SCOM-Agent, you are save to disable to `Intercept Counters`. |
| 58 | + |
| 59 | +To disable these counters, you can run the command `Disable-IcingaInterceptCounter`: |
| 60 | + |
| 61 | +```powershell |
| 62 | +PS> Disable-IcingaInterceptCounter; |
| 63 | +
|
| 64 | +[Notice]: Disabling SCOM intercept counter "HKLM:\SYSTEM\CurrentControlSet\Services\Intercept CSM Filters\Performance" |
| 65 | +[Notice]: SCOM intercept counter "HKLM:\SYSTEM\CurrentControlSet\Services\Intercept Injector\Performance" not installed on the system |
| 66 | +[Notice]: SCOM intercept counter "HKLM:\SYSTEM\CurrentControlSet\Services\Intercept SyncAction Processing\Performance" not installed on the system |
| 67 | +[Notice]: SCOM intercept counter "HKLM:\SYSTEM\CurrentControlSet\Services\InterceptCountersManager\Performance" not installed on the system |
| 68 | +[Notice]: SCOM intercept counter "HKLM:\SYSTEM\CurrentControlSet\Services\InterceptCountersManager\Performance" not installed on the system |
| 69 | +[Notice]: SCOM intercept counter "HKLM:\SYSTEM\CurrentControlSet\Services\Backup Exec\Performance" not installed on the system |
| 70 | +``` |
| 71 | + |
| 72 | +Afterwards reboot your server and the monitoring with plugins using Performance Counter should be fine. |
| 73 | + |
| 74 | +To enable the `Intercept Counters` again, you can run `Enable-IcingaInterceptCounter`: |
| 75 | + |
| 76 | +```powershell |
| 77 | +PS> Enable-IcingaInterceptCounter; |
| 78 | +
|
| 79 | +[Notice]: Enabling SCOM intercept counter "HKLM:\SYSTEM\CurrentControlSet\Services\Intercept CSM Filters\Performance" |
| 80 | +[Notice]: SCOM intercept counter "HKLM:\SYSTEM\CurrentControlSet\Services\Intercept Injector\Performance" not installed on the system |
| 81 | +[Notice]: SCOM intercept counter "HKLM:\SYSTEM\CurrentControlSet\Services\Intercept SyncAction Processing\Performance" not installed on the system |
| 82 | +[Notice]: SCOM intercept counter "HKLM:\SYSTEM\CurrentControlSet\Services\InterceptCountersManager\Performance" not installed on the system |
| 83 | +[Notice]: SCOM intercept counter "HKLM:\SYSTEM\CurrentControlSet\Services\InterceptCountersManager\Performance" not installed on the system |
| 84 | +[Notice]: SCOM intercept counter "HKLM:\SYSTEM\CurrentControlSet\Services\Backup Exec\Performance" not installed on the system |
| 85 | +``` |
| 86 | + |
| 87 | +Again, reboot your server afterwards to complete the changes. |
0 commit comments