VMware {code} Community
alxspb
Contributor
Contributor
Jump to solution

Get Host Events

Hi all

I have a question. To me necessary event about "Host failed to upgrade vCenter agent". How can I get this event via Perl?

I found that it's a VcAgentUpgradeFailedEvent. But my experience coding on Perl it's not good. Smiley Sad

Could you please help me with script?

Thanks a lot!

0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

I'm not sure if you're familiar with the vSphere API/SDKs, but specifically retrieving a specific event and the processes around it is not unique to Perl. The syntax will differ from the various vSphere SDKs (vSphere SDK for Perl, PowerCLI, VI Java, etc) but it's actually understanding how to extract or query for a specific event(s).

Basically you'll need to use the eventManager and create a query specific based on the defined events in the vSphere API documentation.

Take a look at this script - . It's a pretty simple example and you can substitute any event and it should return back the events that it an locate in the system.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

View solution in original post

0 Kudos
1 Reply
lamw
Community Manager
Community Manager
Jump to solution

I'm not sure if you're familiar with the vSphere API/SDKs, but specifically retrieving a specific event and the processes around it is not unique to Perl. The syntax will differ from the various vSphere SDKs (vSphere SDK for Perl, PowerCLI, VI Java, etc) but it's actually understanding how to extract or query for a specific event(s).

Basically you'll need to use the eventManager and create a query specific based on the defined events in the vSphere API documentation.

Take a look at this script - . It's a pretty simple example and you can substitute any event and it should return back the events that it an locate in the system.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos