Invoke-IcingaCheckCPU CPU-Problems

Hi everyone,

I replaced the default checks with the Invoke-Checks some time ago and I noticed that the Invoke-IcingaCheckCPU is very demanding on the CPU. When the check is executed, the CPU load increases a lot and the Icinga then reports a Critical. When the check is run again, it is mostly OK.
However, I have already increased the check repetitions to 3, but this does not solve the problem. The CPUs are usually quad cores. Do you have any ideas?

There is some code caching which should improve this. With 1.6 it is enabled by default and with older versions (at least for 1.5 I am sure) it can be manually enabled: Enable Framework Code Caching - Icinga for Windows

Hey, thank you. I have enabled caching and I can see an improvement. There are still peeks and also false positive alerts. Do you have any other ideas? I found also an issue:

You can try the internal API feature of the PowerShell framework.

I have done some comparisons between the PowerShell framework, the (deprecated) exe files

Maybe making myself a bit unpopular ;):
But in the end we switched all the windows systems to the nsclient, which will be triggered by the Icinga agent locally via check_nscp_api.
The nsclient has a much smaller impact on the systems(about the same as the exe files) and offers more checks/features (e.g. cpu avg values) than the exe files. We still install the PowerShell framework and plugins, as they offer many good check plugins and use them to monitor some specifics (e.g. for Windows Updates).

1 Like

Thanks @log1c for providing the links.

@M.Lake as you can see on the issue it is an on-going effort and in addition to the cache, the next step is the background daemon and the API check forwarder to reduce the overhead even more. I still hope the developer(s) can solve this, but I am not sure if Powershell only can get to the same performance than a compiled executable.

So log1c’s idea with using NSclient would be totally valid and in some aspects it is still the best solution, but the problem I have with NSclient is that development has slowed down so much that I do not want to recommend it anymore also if you only use it locally by offloading the communication to Icinga 2.

Okay, I am aware that PowerShell does not have the performance of a compiled *.exe. It is also not mandatory that the PowerShell has the same performance. But you can see that especially with the CPU check the performance is not very good.
I hope that the development continues there and I would also not like to fall back on the NSclient.

Thank you, for your help. :slight_smile: