VMware {code} Community
begoua
Contributor
Contributor
Jump to solution

How to change properties of Managed Object EventManager

Hello All,

I try to send Log Message on vCenter Server from the vMA installed on

one ESXi 4.0 with the attached script

I used the method "LogUserEvent" and he is working, I can create new log user in vCenter Server.

And now, I try to change the properties of the managed Object "EventManager" to change de categories(not only info, but warning,...) of the log

I turn around...and i need help!

i have found nothing on the VMware documentation.

Thanks a lot

0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

So it sounds like you want to log application information within your guest and somehow send that out to either your vCenter or ESX(i) host? Why not just log within the VM?

If you want to search for certain VM events or events in general, take a look at this script which gives you an example on how to:

If you want to actually browser the actual logs on either vCenter or on ESX(i) host, take a look at the DiagnosticManager and this method will be useful:

BrowseDiagnosticLog

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

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 Comuunity

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

View solution in original post

0 Kudos
8 Replies
lamw
Community Manager
Community Manager
Jump to solution

I a little confused on what you're trying to do, if you take a look at the method LogUserEvent it allows you to log a user defined event on a specific entity as stated in the API documentation. This custom message is defined in the property msg but regarding the EventManager, you can not edit an existing event and you can not create a new EventManager as that object exists by default and is used to primarily query events that have occurred.

What exactly are you trying to accomplish? Are you trying to log a specific event and provide additional information? You may want to query for certain event type which already exists which you can do using the EventManager and then once you find the object that is has that event, you can then use the LogUserEvent to create a custom log entry which you can then parse.

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

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 Comuunity

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

0 Kudos
begoua
Contributor
Contributor
Jump to solution

I have a Application's Server on the vMA, and I would that the apply execute a Perl Script who send new log in vCenter with different categorie and msg,

and after i would execute an alarm who is trigger with an specific Event. because i would consolidate the two apply.(Is that clear?)

it is impossible to change a the properties of the Managed Object EventManager? We can just use the Methods like LogUserEvent?

if it is impossible have you another idea to make this?

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

Unfortunately I'm still not clear on what you're trying to accomplish. If you're goal is to log a specific existing event generated by one of the objects like a host, vm, etc. and from that you can then log your own message using the LogUserEvent, this is probably the best way to do what you're trying to accomplish.

Remember, if there are specific events you would like to key off of, this functionality is already there. From that, you can have your perl script just write out to a local log or something in vMA versus trying to generate your own messages within vCenter/ESX(i) host.

Hopefully this helps out

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

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 Comuunity

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

begoua
Contributor
Contributor
Jump to solution

Oh...Sorry, it's difficulty for me to explain what i want to do, for me it is juste to create an log in vCenter when something happend in an application. to see the log in vCenter from 2 Other VirtualServer( for example: Apache Log)

what is the name of the functionnality to see the log of an Host? if it is possible, i think it is the better way.

Thanks a lot

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

So it sounds like you want to log application information within your guest and somehow send that out to either your vCenter or ESX(i) host? Why not just log within the VM?

If you want to search for certain VM events or events in general, take a look at this script which gives you an example on how to:

If you want to actually browser the actual logs on either vCenter or on ESX(i) host, take a look at the DiagnosticManager and this method will be useful:

BrowseDiagnosticLog

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

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 Comuunity

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

0 Kudos
begoua
Contributor
Contributor
Jump to solution

If i understand the script, it extract Specific Event from the vCenter server in shows the log in a html file,

but me, i will centralize the log of an other server in vCenter,

create new log like the methods LogUserEvent but better(with different categories).

It is to have only one Application open (vSphere Client connected on vCenter) and no many windows on my computer.

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

I think there is still a huge language barrier and I don't think you understand what the sample script is doing. It's just an example of what you can extract from the vCenter logs, it does not have to be in an html file/etc. It's an example

If you're trying to log events that exists, this will work and you can centralize however you want. You will not be able to create your own events to log, you can use LogUserEvent but its limited in terms of what you can do and at most you can log a custom message but you still need to key off of existing events.

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

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 Comuunity

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

0 Kudos
begoua
Contributor
Contributor
Jump to solution

Yes, I see, it is easier to extract in VMware than adding information...

Many Thanks for your help and your time.

0 Kudos