mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 15:19:58 -05:00
Replaced 0 with space for digits and auto added spacing
This commit is contained in:
parent
c27df29aeb
commit
66d007f476
1 changed files with 2 additions and 2 deletions
|
|
@ -17,12 +17,12 @@ function Invoke-IcingaCheckCPU()
|
||||||
|
|
||||||
if ($CpuCounter.Counters.Count -ne 0) {
|
if ($CpuCounter.Counters.Count -ne 0) {
|
||||||
foreach ($counter in $CpuCounter.Counters) {
|
foreach ($counter in $CpuCounter.Counters) {
|
||||||
$IcingaCheck = New-IcingaCheck -Name ([string]::Format('Core #{0}', (Format-IcingaDigitCount $counter.Instance -Digits 3))) -Value $counter.Value().Value -Unit '%';
|
$IcingaCheck = New-IcingaCheck -Name ([string]::Format('Core {0}', (Format-IcingaDigitCount $counter.Instance -Digits ([string](Get-IcingaCpuCount)).Length -Symbol ' '))) -Value $counter.Value().Value -Unit '%';
|
||||||
$IcingaCheck.WarnOutOfRange($Warning).CritOutOfRange($Critical) | Out-Null;
|
$IcingaCheck.WarnOutOfRange($Warning).CritOutOfRange($Critical) | Out-Null;
|
||||||
$CpuPackage.AddCheck($IcingaCheck);
|
$CpuPackage.AddCheck($IcingaCheck);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$IcingaCheck = New-IcingaCheck -Name ([string]::Format('Core #{0}', (Format-IcingaDigitCount $Core -Digits 3))) -Value $CpuCounter.Value().Value -Unit '%';
|
$IcingaCheck = New-IcingaCheck -Name ([string]::Format('Core {0}', (Format-IcingaDigitCount $Core -Digits ([string](Get-IcingaCpuCount)).Length -Symbol ' '))) -Value $CpuCounter.Value().Value -Unit '%';
|
||||||
$IcingaCheck.WarnOutOfRange($Warning).CritOutOfRange($Critical) | Out-Null;
|
$IcingaCheck.WarnOutOfRange($Warning).CritOutOfRange($Critical) | Out-Null;
|
||||||
$CpuPackage.AddCheck($IcingaCheck);
|
$CpuPackage.AddCheck($IcingaCheck);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue