From 13f7a7f0db9b34f79df026c9de3590e82aaa6e18 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Mon, 16 Sep 2019 18:07:57 +0200 Subject: [PATCH] Removed leading '_' from Total core --- lib/plugins/Invoke-IcingaCheckCPU.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/plugins/Invoke-IcingaCheckCPU.psm1 b/lib/plugins/Invoke-IcingaCheckCPU.psm1 index da9809f..189649b 100644 --- a/lib/plugins/Invoke-IcingaCheckCPU.psm1 +++ b/lib/plugins/Invoke-IcingaCheckCPU.psm1 @@ -18,12 +18,12 @@ function Invoke-IcingaCheckCPU() if ($CpuCounter.Counters.Count -ne 0) { foreach ($counter in $CpuCounter.Counters) { - $IcingaCheck = New-IcingaCheck -Name ([string]::Format('Core {0}', (Format-IcingaDigitCount $counter.Instance -Digits $CpuCount -Symbol ' '))) -Value $counter.Value().Value -Unit '%'; + $IcingaCheck = New-IcingaCheck -Name ([string]::Format('Core {0}', (Format-IcingaDigitCount $counter.Instance.Replace('_', '') -Digits $CpuCount -Symbol ' '))) -Value $counter.Value().Value -Unit '%'; $IcingaCheck.WarnOutOfRange($Warning).CritOutOfRange($Critical) | Out-Null; $CpuPackage.AddCheck($IcingaCheck); } } else { - $IcingaCheck = New-IcingaCheck -Name ([string]::Format('Core {0}', (Format-IcingaDigitCount $Core -Digits $CpuCount -Symbol ' '))) -Value $CpuCounter.Value().Value -Unit '%'; + $IcingaCheck = New-IcingaCheck -Name ([string]::Format('Core {0}', (Format-IcingaDigitCount $Core.Replace('_', '') -Digits $CpuCount -Symbol ' '))) -Value $CpuCounter.Value().Value -Unit '%'; $IcingaCheck.WarnOutOfRange($Warning).CritOutOfRange($Critical) | Out-Null; $CpuPackage.AddCheck($IcingaCheck); }