VMware {code} Community
roprabhu
Contributor
Contributor

Can Alarms be created for User Logged events (using EventAlarmExpression) ?

Hi,

I want to create an alarm object which should go off when I log an event using LogUserEvent() in VCenter.

Is this possible ?.

What is the event type string for User logged events ?.

Thanks,

Roopa

0 Kudos
5 Replies
njain
Expert
Expert

Yes, you can create an alarm for an event that is logged using LogUserEvent() using the CreateAlarm API.

http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.alarm.AlarmManager.htm...

This API requires AlarmSpec parameter. For the "expression" property of this spec, you can implement "EventAlarmExpression" and provide the event type as "GeneralUserEvent" (which is logged, when the user logs a event using LogUserEvent() method). In the "action", you can implement the desired action which will be performed when the alarm is triggered.

Hope this information is helpful.

Neha

0 Kudos
njain
Expert
Expert

Attached is a sample in Java that creates an alarm for user logged event and powers on the vm, when the alarm is triggered.

0 Kudos
roprabhu
Contributor
Contributor

hey...Thanks neha. That helps. Will try it out..

0 Kudos
nehaparmar
Contributor
Contributor

Hey,

    Can you please tell me how can we log a user based event using loguserevent api in java????

-Neha.

0 Kudos
nehaparmar
Contributor
Contributor

Hi all,

      I want to create custom events in vcenter server and log that event in the events tab using postevent method. Can you tell me how this can be achieved?? I tried doing using ExtendedEvent but it didnt work. Moreover, Can you please explain me the difference between ExtendedEvent and EventEx??

      Appericiate your help.

Regards,

Neha.

0 Kudos