File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -89,9 +89,7 @@ function Invoke-IcingaCheckTimeSync()
89
89
- MetricIndex $Server `
90
90
- MetricName ' service' ;
91
91
92
- if ($IgnoreService -eq $FALSE ) {
93
- $TimeCheck.CritIfNotMatch ($ProviderEnums.ServiceStatus.Running ) | Out-Null ;
94
- }
92
+ $TimeCheck.CritIfNotMatch ($ProviderEnums.ServiceStatus.Running ) | Out-Null ;
95
93
96
94
$SyncStatus = New-IcingaCheck `
97
95
- Name ' Sync Status' `
@@ -101,13 +99,15 @@ function Invoke-IcingaCheckTimeSync()
101
99
102
100
$SyncStatus.CritIfMatch ($ProviderEnums.TimeSyncStatus.ClockNotSynchronized ) | Out-Null ;
103
101
102
+ if ($IgnoreService ) {
103
+ $checks = @ ($OffsetCheck , $SyncStatus )
104
+ } else {
105
+ $checks = @ ($OffsetCheck , $TimeCheck , $SyncStatus )
106
+ }
107
+
104
108
$CheckPackage = New-IcingaCheckPackage `
105
109
- Name ' Time Package' `
106
- - Checks @ (
107
- $OffsetCheck ,
108
- $TimeCheck ,
109
- $SyncStatus
110
- ) `
110
+ - Checks $checks `
111
111
- OperatorAnd `
112
112
- Verbose $Verbosity ;
113
113
You can’t perform that action at this time.
0 commit comments