Skip to content

Commit

Permalink
Merge pull request #51 from Icinga:fix/eventlog_crash
Browse files Browse the repository at this point in the history
Fix crash on eventlog check for not found filter entries
  • Loading branch information
LordHepipud authored Aug 22, 2020
2 parents beb2b00 + 3b2830c commit 20da818
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/31-Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ This release adds the following new plugins:
* [#36](https://github.com/Icinga/icinga-powershell-plugins/issues/36) Fixes Ok return value for Invoke-IcingaCheckDirectory while -Path argument is not set
* [#37](https://github.com/Icinga/icinga-powershell-plugins/issues/37) Fixes `-FileNames` argument being ignored for Invoke-IcingaCheckDirectory while not using the `-Recurse` argument
* [#40](https://github.com/Icinga/icinga-powershell-plugins/issues/40) Fixes `Get-TimeZone` Cmdlet not known for `Invoke-IcingaCheckTimeSync` on Windows 2012 R2 and older
* [#50](https://github.com/Icinga/icinga-powershell-plugins/issues/50), [#51](https://github.com/Icinga/icinga-powershell-plugins/issues/51) Fixes possible crash/artifacts on plugin output for EventLog check while filters do not match any entry

## 1.1.0 (2020-06-02)

Expand Down
3 changes: 1 addition & 2 deletions provider/eventlog/Get-IcingaEventLog.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,10 @@ function Get-IcingaEventLog()
}

try {
$events = Get-EventLog @EventLogArguments;
$events = Get-EventLog @EventLogArguments -ErrorAction Stop;
} catch {
Exit-IcingaThrowException -InputString $_.Exception -StringPattern 'ParameterBindingValidationException' -ExceptionType 'Input' -ExceptionThrown $IcingaExceptions.Inputs.EventLog;
Exit-IcingaThrowException -InputString $_.Exception -StringPattern 'System.InvalidOperationException' -CustomMessage (-Join $LogName) -ExceptionType 'Input' -ExceptionThrown $IcingaExceptions.Inputs.EventLogLogName;
Exit-IcingaThrowException -InputString $_.Exception -ExceptionType 'Unhandled' -Force;
}

if ($null -ne $ExcludeEventId -Or $null -ne $ExcludeUsername -Or $null -ne $ExcludeEntryType -Or $null -ne $ExcludeMessage -Or $null -ne $IncludeMessage) {
Expand Down

0 comments on commit 20da818

Please sign in to comment.