File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments