Skip to content
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 II #131

Closed
i3astian opened this issue Feb 5, 2021 · 1 comment · Fixed by #144
Closed

Invoke-IcingaCheckEventlog - ExcludeEventId not working II #131

i3astian opened this issue Feb 5, 2021 · 1 comment · Fixed by #144
Assignees
Labels
question Further information is requested

Comments

@i3astian
Copy link

i3astian commented Feb 5, 2021

Hello,

In the current version the problem mentioned in #19 is back again.
With commit 39d66e56fa8784e8c5c3d13e684ed4ee35ed13ae the fix from commit 8dcf91e281817b60bf12be7461987d663a3a5d7b was reverted.

Maybe you can implement it in a way like this (Line 99-132):

            if ($skip) {
                continue;
            }

			if ($null -ne $IncludeEventId -Or $null -ne $IncludeMessage -Or $null -ne $IncludeSource) {    
				$skip = $TRUE;

				if ($IncludeMessage.Count -ne 0) {
					foreach ($inMessage in $IncludeMessage) {
						# Filter for specific message content
						if ([string]$event.Message -like [string]$inMessage) {
							$skip = $FALSE;
							break;
						}
					}
				}

				# We might be looking for specific event ids and 
				if ($IncludeEventId.Count -ne 0 -And $IncludeEventId -contains $event.EventId) {
					$skip = $FALSE;
				}

				# We might be looking for specific event sources
				if ($IncludeSource.Count -ne 0 -And $IncludeSource -contains $event.Source) {
					$skip = $FALSE;
				}

				if ($skip) {
					continue;
				}
			}

            $filteredEvents += $event;
        }
@LordHepipud
Copy link
Collaborator

Thank you for the input. Are you sure this is broken? In October I redesigned the plugin and so far all event Id's I want to monitor are returned. By using the old fix im sometimes not getting the results I want.

The new version matches for the EventId instead of the `InstanceId, which is the correct implementation.

@LordHepipud LordHepipud added the question Further information is requested label Feb 23, 2021
@LordHepipud LordHepipud self-assigned this Feb 23, 2021
@LordHepipud LordHepipud linked a pull request Apr 23, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants