File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,16 +150,17 @@ elseif ($count -ge $warnThreshold) {
150150 }
151151 exit $warnExitCode
152152}
153- else {
154- if ($count -eq 0 ) { Write-Output " INFO: No error events in last $evaluationWindowHours hours." }
155- else {
156- Write-Output " INFO: $count error event(s) in last $evaluationWindowHours hours (below warning threshold: $warnThreshold )."
157- $errorsInEvaluationWindow | ForEach-Object {
158- Write-Output " TimeCreated: $ ( $_.TimeCreated ) "
159- Write-Output " Event ID: $ ( $_.Id ) "
160- Write-Output " Message: $ ( $_.Message ) "
161- Write-Output " ----------------------------------------"
162- }
153+ elseif ($count -ge $infoThreshold ) {
154+ Write-Output " INFO: $count error event(s) in last $evaluationWindowHours hours (below warning threshold: $warnThreshold )."
155+ $errorsInEvaluationWindow | ForEach-Object {
156+ Write-Output " TimeCreated: $ ( $_.TimeCreated ) "
157+ Write-Output " Event ID: $ ( $_.Id ) "
158+ Write-Output " Message: $ ( $_.Message ) "
159+ Write-Output " ----------------------------------------"
163160 }
164161 exit $infoExitCode
162+ }
163+ else {
164+ Write-Output " OK: $count error events in last $evaluationWindowHours hours (below all thresholds)."
165+ exit 0
165166}
You can’t perform that action at this time.
0 commit comments