-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invoke-IcingaCheckEventlog - ExcludeEventId not working #19
Comments
Hello and thank you for the report. I will have a look on this tomorrow and report back with a hopefully fixed result. Could you please add your check configuration here? Then I could properly test with your case if the issue is fixed or if it persists. Thank you in advance! |
Hi, a little bit late, but here's the configuration: commands.conf:
services.conf:
templates.conf:
host.conf:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When you use "Invoke-IcingaCheckEventlog" with only "LogName" and "ExcludeEventId" you get 0 as output.
In "Get-IcingaEventLog.psm1" is one
foreach
loop, which is used to check the Exclude Arguments and the "IncludeMessage" Argument. Without the "IncludeMessage" Argument$skip
is always true and Line 109$filteredEvents += $event;
won't be reached.For testing I disabled the Lines 95-107:
Now I received EventID's but the output also contained the excluded EventID's.
There seems to be an syntax error for the
if
checks in Lines 68, 73 and 78.Syntax -contains:
if ($ExcludeEventId.Count -ne 0 -And $event.InstanceID -contains $ExcludeEventId) {
should be
if ($ExcludeEventId.Count -ne 0 -And $ExcludeEventId -contains $event.InstanceID) {
The text was updated successfully, but these errors were encountered: