Is there any SRM API to get alert/event when any error or prompt occurs when recovery plan is executing in SRM ?
I don't fully understand your question.
What are you trying to achieve?
You have the following APIs to handle prompts:
ListPrompts List the current prompts that are waiting for input. When a prompt step is reached, the plan goes into waiting state until AnswerPrompt is received. Prompts are given in the same order in which VMs are scheduled to start up.
AnswerPrompt Answer the current prompt displayed by a Recovery Plan. Requires the Run privilege for test, or the Failover privilege for the other modes.
What do you mean by getting an alert? Where, in vCenter?
Thanks for your reply. What I wanted to know that can we trap any alert/event which could occur when some error/prompt comes when recovery plan is executing. Like some waitForUpdate() kind of API which can be called on reocvery plan executiong . Or any API which could give me alert/event on completion of every step in recovery plan. When reocvery plan executes does it generate any event which can be trapped and used to show some info about step executed successfully or failed.
SRM does log events for many of its actions.
See "Events and Alarms" section on page 93 of the SRM 5.0 admin guide and particularily page 96 "Recovery Events". I can see several events that might be helpful:
It even looks like you have events for individual command steps:
You can use SNMP traps to get the events:
SRM provides Simple Network Management Protocol (SNMP) traps that collect information sent by the API. All traps are compliant with the SNMPv1 type. Information provided by the traps can be used to initiate actions by client applications. Callers of the SRM API interface should listen for the SNMP traps listed below. You might need to configure the vCenter Server to forward the SNMP traps to the registered SNMP Server.
The MIB file is located in the following directory:
or I believe you can get them from vCenter via vSphere API.