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 2f874fa4d2
commit a33455f343

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);
}