PowerCLI: Reading the VMKERNEL logfiles with Powershell v2


image

I was reading Alan Renouf his post about reading the vmkernel log files with PowerCLI. Carter Shanklin posted a comment with the Powershell v2 way of doing this task. I grabbed his one-liner and added a foreach ( % ) loop and the Out-GridView cmdlet. Now with the foreach loop, the one-liner will run against all my ESX Servers.

Get-VMHost |% {Get-Log -VmHost $_ vmkernel |Select -expand Entries } |Out-GridView

The Out-GridView cmdlet will show us all the vmkernel logfiles together in one window.

image

If want to filter on Warning messages only, run the following one-liner:

Get-VMHost | % { Get-Log -VmHost $_ vmkernel | 
Select -expand Entries | Select-String WARNING } | Out-GridView

If there are Warnings in the vmkernel log, the following GridView will be created:

image

If you want to filter the output in the GridView, just use the filter box and if necessary, you can add a criteria:

image

Advertisements

One thought on “PowerCLI: Reading the VMKERNEL logfiles with Powershell v2

  1. Pingback: Bookmark Friday | Total Verfriemelt

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s