Check Commands will now return their Exit Code instead of exiting

This commit is contained in:
Lord Hepipud 2019-09-25 19:57:19 +02:00
parent 928602a2e6
commit b95281a1d8
9 changed files with 9 additions and 9 deletions

View file

@ -4,5 +4,5 @@ function Invoke-IcingaCheckBiosSerial()
{ {
$Bios = Get-IcingaBiosSerialNumber; $Bios = Get-IcingaBiosSerialNumber;
$BiosCheck = New-IcingaCheck -Name $Bios.Name -Value $Bios.Value -NoPerfData; $BiosCheck = New-IcingaCheck -Name $Bios.Name -Value $Bios.Value -NoPerfData;
exit (New-IcingaCheckresult -Check $BiosCheck -NoPerfData $TRUE -Compile); return (New-IcingaCheckresult -Check $BiosCheck -NoPerfData $TRUE -Compile);
} }

View file

@ -28,5 +28,5 @@ function Invoke-IcingaCheckCPU()
$CpuPackage.AddCheck($IcingaCheck); $CpuPackage.AddCheck($IcingaCheck);
} }
exit (New-IcingaCheckResult -Name 'CPU Load' -Check $CpuPackage -NoPerfData $NoPerfData -Compile); return (New-IcingaCheckResult -Name 'CPU Load' -Check $CpuPackage -NoPerfData $NoPerfData -Compile);
} }

View file

@ -50,5 +50,5 @@ function Invoke-IcingaCheckEventlog()
$EventLogPackage.AddCheck($IcingaCheck); $EventLogPackage.AddCheck($IcingaCheck);
} }
exit (New-IcingaCheckResult -Name 'EventLog' -Check $EventLogPackage -NoPerfData $NoPerfData -Compile); return (New-IcingaCheckResult -Name 'EventLog' -Check $EventLogPackage -NoPerfData $NoPerfData -Compile);
} }

View file

@ -30,5 +30,5 @@ function Invoke-IcingaCheckProcessCount()
} }
exit (New-IcingaCheckResult -Check $ProcessPackage -NoPerfData $NoPerfData -Compile); return (New-IcingaCheckResult -Check $ProcessPackage -NoPerfData $NoPerfData -Compile);
} }

View file

@ -75,5 +75,5 @@ function Invoke-IcingaCheckService()
$ServicesPackage.AddCheck($IcingaCheck); $ServicesPackage.AddCheck($IcingaCheck);
} }
exit (New-IcingaCheckResult -Name 'Services' -Check $ServicesPackage -NoPerfData $TRUE -Compile); return (New-IcingaCheckResult -Name 'Services' -Check $ServicesPackage -NoPerfData $TRUE -Compile);
} }

View file

@ -54,5 +54,5 @@ function Invoke-IcingaCheckUpdates()
$UpdatePackage.AddCheck($UpdateList); $UpdatePackage.AddCheck($UpdateList);
} }
exit (New-IcingaCheckResult -Name 'Pending Updates' -Check $UpdatePackage -NoPerfData $NoPerfData -Compile); return (New-IcingaCheckResult -Name 'Pending Updates' -Check $UpdatePackage -NoPerfData $NoPerfData -Compile);
} }

View file

@ -23,5 +23,5 @@ function Invoke-IcingaCheckUptime()
$CheckPackage = New-IcingaCheckPackage -Name $Name -OperatorAnd -Checks $IcingaCheck -Verbose $Verbose; $CheckPackage = New-IcingaCheckPackage -Name $Name -OperatorAnd -Checks $IcingaCheck -Verbose $Verbose;
exit (New-IcingaCheckresult -Check $CheckPackage -NoPerfData $NoPerfData -Compile); return (New-IcingaCheckresult -Check $CheckPackage -NoPerfData $NoPerfData -Compile);
} }

View file

@ -36,5 +36,5 @@ function Invoke-IcingaCheckUsedPartitionSpace()
$DiskPackage.AddCheck($IcingaCheck); $DiskPackage.AddCheck($IcingaCheck);
} }
exit (New-IcingaCheckResult -Check $DiskPackage -NoPerfData $NoPerfData -Compile); return (New-IcingaCheckResult -Check $DiskPackage -NoPerfData $NoPerfData -Compile);
} }

View file

@ -38,5 +38,5 @@ function Invoke-IcingaCheckUsers()
$UsersPackage.AddCheck($IcingaCheck) $UsersPackage.AddCheck($IcingaCheck)
} }
exit (New-IcingaCheckResult -Name 'Users' -Check $UsersPackage -NoPerfData $NoPerfData -Compile); return (New-IcingaCheckResult -Name 'Users' -Check $UsersPackage -NoPerfData $NoPerfData -Compile);
} }