Skip to content

Commit 82af87e

Browse files
author
Lorenz Kästle
committed
CheckTimeSync: Let "IgnoreService" truly ignore the local service
1 parent 1570c58 commit 82af87e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: plugins/Invoke-IcingaCheckTimeSync.psm1

+8-8
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ function Invoke-IcingaCheckTimeSync()
8989
-MetricIndex $Server `
9090
-MetricName 'service';
9191

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

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

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

102+
if ($IgnoreService) {
103+
$checks = @($OffsetCheck, $SyncStatus)
104+
} else {
105+
$checks = @($OffsetCheck, $TimeCheck, $SyncStatus)
106+
}
107+
104108
$CheckPackage = New-IcingaCheckPackage `
105109
-Name 'Time Package' `
106-
-Checks @(
107-
$OffsetCheck,
108-
$TimeCheck,
109-
$SyncStatus
110-
) `
110+
-Checks $checks `
111111
-OperatorAnd `
112112
-Verbose $Verbosity;
113113

0 commit comments

Comments
 (0)