icinga-powershell-plugins icon indicating copy to clipboard operation
icinga-powershell-plugins copied to clipboard

Invoke-IcingaCheckProcess - Summary shows more than 100% CPU Usage

Open tectumopticum opened this issue 1 year ago • 0 comments

If Invoke-IcingaCheckProcess detects more than one instance of a process and "cpu-usage" (-TotalCPUCritical or -TotalCPUWarning) is set, the output is the total (sum) of all matching processes, which is sometimes > 100%:

Invoke-IcingaCheckProcess -TotalCPUWarning 50 -TotalCPUCritical 80 -Process powershell -Verbosity 2

Invoke-IcingaCheckProcess - powershell process properties

You can reproduce this with "CPUSTRES64.EXE" but you have to rename the binary to ".exe" before starting it. Otherwise the plugin won't find the process:

PS C:\> Invoke-IcingaCheckProcess -TotalCPUWarning 50 -TotalCPUCritical 80 -Process CPUSTRES64 -Verbosity 2
[CRITICAL] Process Overview: 1 Critical [CRITICAL] CPUSTRES64
\_ [CRITICAL] CPUSTRES64
   \_ [OK] CPUSTRES64 [5296]
      \_ [OK] CPU Usage: 34.00%
      \_ [OK] Memory Usage: 1.86MiB
      \_ [OK] Page File Usage: 2.60KiB
      \_ [OK] Thread Count: 7c
   \_ [OK] CPUSTRES64 [6456]
      \_ [OK] CPU Usage: 152.00%
      \_ [OK] Memory Usage: 2.00MiB
      \_ [OK] Page File Usage: 2.76KiB
      \_ [OK] Thread Count: 12c
   \_ [CRITICAL] CPUSTRES64 Summary
      \_ [CRITICAL] CPU Usage: 186.00% is greater than threshold 80%
      \_ [OK] Memory Usage: 3.86MiB
      \_ [OK] Page File Usage: 5.36KiB
      \_ [OK] Process Count: 2c
      \_ [OK] Thread Count: 19c
| 'cpustres64::ifw_process::cpu'=186%;50;80;0;186 'cpustres64::ifw_process::pagefile'=5488B;;;0;1280 'cpustres64::ifw_process::count'=2c;; 'cpustres64::ifw_process::memory'=4050944B;;;0;8589398000 'cpustres64::ifw_process::threads'=19c;;
2

Result with .EXE: [UNKNOWN] Process Overview: No checks added to this package

tectumopticum avatar Jun 01 '23 15:06 tectumopticum