mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Added further options in ProcessCount-Check
This commit is contained in:
parent
6612fcd1aa
commit
837fa32fc1
1 changed files with 11 additions and 4 deletions
|
|
@ -15,13 +15,20 @@ function Invoke-IcingaCheckProcessCount()
|
||||||
|
|
||||||
$ProcessPackage = New-icingaCheckPackage -Name "Process Check" -OperatorAnd -Verbose $Verbose -NoPerfData $NoPerfData;
|
$ProcessPackage = New-icingaCheckPackage -Name "Process Check" -OperatorAnd -Verbose $Verbose -NoPerfData $NoPerfData;
|
||||||
|
|
||||||
foreach ($proc in $process) {
|
if ($Process.Count -eq 0) {
|
||||||
$ProcessCount = $ProcessInformation."Processes".$proc.processlist.Count;
|
$ProcessCount = $ProcessInformation['Process Count'];
|
||||||
$IcingaCheck = New-IcingaCheck -Name ([string]::Format('Process Count "{0}"', $proc)) -Value $ProcessCount;
|
$IcingaCheck = New-IcingaCheck -Name ([string]::Format('Process Count')) -Value $ProcessCount;
|
||||||
$IcingaCheck.WarnOutOfRange($Warning).CritOutOfRange($Critical) | Out-Null;
|
$IcingaCheck.WarnOutOfRange($Warning).CritOutOfRange($Critical) | Out-Null;
|
||||||
$ProcessPackage.AddCheck($IcingaCheck);
|
$ProcessPackage.AddCheck($IcingaCheck);
|
||||||
|
} else {
|
||||||
|
foreach ($proc in $process) {
|
||||||
|
$ProcessCount = $ProcessInformation."Processes".$proc.processlist.Count;
|
||||||
|
$IcingaCheck = New-IcingaCheck -Name ([string]::Format('Process Count "{0}"', $proc)) -Value $ProcessCount;
|
||||||
|
$IcingaCheck.WarnOutOfRange($Warning).CritOutOfRange($Critical) | Out-Null;
|
||||||
|
$ProcessPackage.AddCheck($IcingaCheck);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
exit (New-IcingaCheckResult -Check $ProcessPackage -NoPerfData $TRUE -Compile);
|
exit (New-IcingaCheckResult -Check $ProcessPackage -NoPerfData $NoPerfData -Compile);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue