Fixes broken service check due to content validation

This commit is contained in:
Lord Hepipud 2019-10-29 17:55:40 +01:00
parent cd591f6f43
commit 73b761a4dc

View file

@ -59,11 +59,11 @@ function Invoke-IcingaCheckService()
$FoundService = Get-IcingaServices -Service $Service; $FoundService = Get-IcingaServices -Service $Service;
$ServiceName = Get-IcingaServiceCheckName -ServiceInput $Service -Service $FoundService; $ServiceName = Get-IcingaServiceCheckName -ServiceInput $Service -Service $FoundService;
$Status = ConvertTo-ServiceStatusCode -Status $Status; $IntStatus = ConvertTo-ServiceStatusCode -Status $Status;
$StatusRaw = $FoundService.Values.configuration.Status.raw; $StatusRaw = $FoundService.Values.configuration.Status.raw;
$IcingaCheck = New-IcingaCheck -Name $ServiceName -Value $StatusRaw -ObjectExists $FoundService -Translation $ProviderEnums.ServiceStatusName; $IcingaCheck = New-IcingaCheck -Name $ServiceName -Value $StatusRaw -ObjectExists $FoundService -Translation $ProviderEnums.ServiceStatusName;
$IcingaCheck.CritIfNotMatch($Status) | Out-Null; $IcingaCheck.CritIfNotMatch($IntStatus) | Out-Null;
$ServicesPackage.AddCheck($IcingaCheck); $ServicesPackage.AddCheck($IcingaCheck);
} }