Skip to content

Commit

Permalink
CheckTimeSync: Let "IgnoreService" truly ignore the local service
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenz Kästle committed Oct 21, 2024
1 parent 1570c58 commit 82af87e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions plugins/Invoke-IcingaCheckTimeSync.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ function Invoke-IcingaCheckTimeSync()
-MetricIndex $Server `
-MetricName 'service';

if ($IgnoreService -eq $FALSE) {
$TimeCheck.CritIfNotMatch($ProviderEnums.ServiceStatus.Running) | Out-Null;
}
$TimeCheck.CritIfNotMatch($ProviderEnums.ServiceStatus.Running) | Out-Null;

$SyncStatus = New-IcingaCheck `
-Name 'Sync Status' `
Expand All @@ -101,13 +99,15 @@ function Invoke-IcingaCheckTimeSync()

$SyncStatus.CritIfMatch($ProviderEnums.TimeSyncStatus.ClockNotSynchronized) | Out-Null;

if ($IgnoreService) {
$checks = @($OffsetCheck, $SyncStatus)
} else {
$checks = @($OffsetCheck, $TimeCheck, $SyncStatus)
}

$CheckPackage = New-IcingaCheckPackage `
-Name 'Time Package' `
-Checks @(
$OffsetCheck,
$TimeCheck,
$SyncStatus
) `
-Checks $checks `
-OperatorAnd `
-Verbose $Verbosity;

Expand Down

0 comments on commit 82af87e

Please sign in to comment.