Fixed update list throwing unknown for 0 pending updates

This commit is contained in:
Lord Hepipud 2019-09-13 17:04:05 +02:00
parent f0b86ec346
commit 035fbb8d49

View file

@ -47,8 +47,12 @@ function Invoke-IcingaCheckUpdates()
$UpdateCount.AddCheck($IcingaCheck);
$UpdatePackage = New-IcingaCheckPackage -Name 'Updates' -OperatorAnd -Verbose $Verbose -Checks @(
$UpdateCount, $UpdateList
$UpdateCount
);
if ($PendingCount -ne 0) {
$UpdatePackage.AddCheck($UpdateList);
}
exit (New-IcingaCheckResult -Name 'Pending Updates' -Check $UpdatePackage -NoPerfData $NoPerfData -Compile);
}