Closed randy16randy closed 10 years ago
Hi Randy,
try this:
$Warnings = (Get-Log –VMHost ($VMHost.Name) -Key vmkernel -ErrorAction SilentlyContinue).Entries | where {$_ -match "warning" -and $_ -notmatch "unsupported ioctl 58"}
Probably worth looking at providing a way to filter kernel warnings for stuff like this...
let me know how you go
Perfect! Thanks.
-Randy-
From: Sneddo [mailto:notifications@github.com] Sent: Sun, April 27, 2014 10:00 PM To: alanrenouf/vCheck-vSphere Cc: Randy Redekopp Subject: Re: [vCheck-vSphere] 44 VMKernel Warnings - want to filter some messages out (#191)
Hi Randy,
try this: $Warnings = (Get-Log –VMHost ($VMHost.Name) -Key vmkernel -ErrorAction SilentlyContinue).Entries | where {$ -match "warning" -and $ -notmatch "unsupported ioctl 58"}
Probably worth looking at providing a way to filter kernel warnings for stuff like this...
let me know how you go
— Reply to this email directly or view it on GitHubhttps://github.com/alanrenouf/vCheck-vSphere/issues/191#issuecomment-41521293.
Hopefully this is also the place to post questions...
In plugin 44 for VMKernal Warnings, I want to be able to filter out certain messages from the vCheck report. Its OK that they stay in vCenter so I have the full history there so i want to do it within the plugin script but do not know how.
I assume it is this line (9) that would be modified: $Warnings = (Get-Log -vmhost ($VMHost.name) -Key messages -ErrorAction SilentlyContinue).entries |where {$ -match "warning" -and $ -match "vmkernel"}
if I add another AND to the end so that it does NOT report messages where the message text includes "unsupported ioctl 58" I can't seem to get the syntax correct. I know SQL scripting but couldn't find any similar examples to help me with this.
Thanks!
The full script I am using for that plugin is:
Start of Settings