Hi All,
I'd like to know if it is possible to get or pull the ESXi host information using PowerCLI 4.0 for ESXi 4.0 ?
eg. to get the ESXi log about RAID hard disk failure ? rather than having to ssh UNSUPPORTED to the The VMkernel, vmkwarning, and hostd logs at /var/log/messages
Kind Regards,
AWT
The commands do work with ESXi. You can configure ESXi to send logs to a syslog receiver under advanced settings. ESXi can also copy the log files to a datastore locations.
With the vMA the vi-logger component is configured to pull log file from ESXi (and vCenter as well).
Dave
VMware Communities User Moderator
Now available - vSphere Quick Start Guide
Do you have a system or PCI card working with VMDirectPath? Submit your specs to the Unofficial VMDirectPath HCL.
You can use Get-Log. You can also pipe to Select-String to filter the output.
Get-Log messages | select -ExpandProperty Entries
Get-Log hostd | select -ExpandProperty Entries
Get-Log vpxa | select -ExpandProperty Entries
Dave
VMware Communities User Moderator
Now available - vSphere Quick Start Guide
Do you have a system or PCI card working with VMDirectPath? Submit your specs to the Unofficial VMDirectPath HCL.
Thanks for the reply Dave,
here's what I've got:
Connect-VIServer -Server 'vCenter'
Get-Log messages | select -ExpandProperty Entries
Get-Log hostd | select -ExpandProperty Entries
Get-Log vpxa | select -ExpandProperty Entries
it stopped with Error:
7/09/2010 7:07:26 PM Get-Log 4651586F-4369-43DE-B54E-50F9ACEAC997 Log with key 'messages' not found.
At :line:3 char:7
+ Get-Log <<<< messages | select -ExpandProperty Entries
7/09/2010 7:07:26 PM Get-Log 4651586F-4369-43DE-B54E-50F9ACEAC997 Log with key 'hostd' not found.
At :line:4 char:7
+ Get-Log <<<< hostd | select -ExpandProperty Entries
7/09/2010 7:07:27 PM Get-Log 4651586F-4369-43DE-B54E-50F9ACEAC997 Log with key 'vpxa' not found.
At :line:5 char:7
+ Get-Log <<<< vpxa | select -ExpandProperty Entries
is itbecause i'm using ESXi 4.0
Kind Regards,
AWT
To get the ESX logs you have to connect to the ESX server instead of the vCenter.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
thanks Luc, is this script work for the ESXi ? as i don't have ESX installed on my production environment.
It should work for ESXi as well.
You might want to consider configuring your ESXi boxes to a log to a central syslog server. If you want something supported by VMware, you might want to consider the vMA appliance.
Thanks,
Sia
ok, thanks foryour reply
to log the entry to syslog can ESXi do that ?
and regarding the vMA, does it pulls all of the log or it does act as the syslog for all of our ESXi server ?
The commands do work with ESXi. You can configure ESXi to send logs to a syslog receiver under advanced settings. ESXi can also copy the log files to a datastore locations.
With the vMA the vi-logger component is configured to pull log file from ESXi (and vCenter as well).
Dave
VMware Communities User Moderator
Now available - vSphere Quick Start Guide
Do you have a system or PCI card working with VMDirectPath? Submit your specs to the Unofficial VMDirectPath HCL.