Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 232869

Trigger a default alarm

$
0
0

I am using vCO 5 with vCenter 5 plug-in.  I am creating a workflow that prepares a brand new VM that is brought into the environment (it connects the VM to the Active Directory, HIDS, etc).  I would like to trigger a default alarm (for example, the VM Error alarm that gets triggered by the VcGeneralVMErrorEvent) when this workflow fails.  What would be code required to do this?

 

Alternatively, can I create an alarm that is triggered by the "LogUserEvent"?

 

I have tried the following code.  I need help with:

Populating the parameters in the commented code.  Also, is this the right path to take?

 

 

var vmErrorEvent = new VcGeneralVmErrorEvent();
vmErrorEvent.fullFormattedMessage = "My message";
vmErrorEvent.createdTime = new Date();
vmErrorEvent.userName = "Tripwire Server";
vmErrorEvent.message = "My message";//vmErrorEvent.vm = new  VcVmEventArgument(???, vcVM);//vmErrorEvent.chainId = ??//vmErrorEvent.key = ?? 
var sdk = vcVM.sdkConnection;
var eventMgr = sdk.eventManager; 
eventMgr.postEvent(vmErrorEvent);

 

Thanks in advance for your help!

 

Message was edited by: standVM


Viewing all articles
Browse latest Browse all 232869

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>