Hi,
quick question, how can i retrieve the action information from an alarm which has been retrieved with something like this:
AllAlarms = AllSdkConnection[cc].alarmManager.getAlarm();
for (var ac in AllAlarms) {
....
}
Any ideas,
TIA
Thomas
aaaand, here we go:
Onyx & MOB hand in hand should give you the idea....
and yes, the object model for the alarms seems quite messy :smileyconfused:.
Cheers,
Joerg
Please check if this helps you: http://www.vcoteam.info/learn-vco/code-snippets-get-vms-that-triggered-vcenter-alarms.html
Hi,
hmm, found not really the answer. For me the question ist for example, is an snmp action configured if this alarm gets triggered, or is an SMTP action configured, and which is the configured E-Mail.
Regards
Thomas
my approach to such things:
Change the action, and watch with Onyx which attributes are touched....
and: use the managed object browser to click through your actual vCenter inventory...
http://www.vcoportal.de/2012/05/using-onyx-for-fast-workflow-development/
http://www.virtuallyghetto.com/2010/07/whats-new-in-vsphere-41-mob.html
Cheers,
Joerg
aaaand, here we go:
Onyx & MOB hand in hand should give you the idea....
and yes, the object model for the alarms seems quite messy :smileyconfused:.
Cheers,
Joerg
Hi,
yup this is the same i found with a different approach. Wrote a small function which did a recursive dump of an alarm, and based on this my solution is:
if (MyAlarm.info.action) {
// VcAlarm.info(VcAlarmInfo).action(VcAlarmAction).array[VcAlarmTriggeringAction].VcSendEmailAction|VcSendSNMPAction
for (var i in MyAlarm.info.action.action) {
try {
if (MyAlarm.info.action.action[i].action instanceof VcSendEmailAction ) {
System.debug("VcSendEmailAction configured");
System.debug("\ttoList "+MyAlarm.info.action.action[i].action.toList);
System.debug("\tsubject "+MyAlarm.info.action.action[i].action.subject);
} else if (MyAlarm.info.action.action[i].action instanceof VcSendSNMPAction) {
System.debug("VcSendSNMPAction configured");
}
} catch(ex) {
System.debug("Catched "+ex);
}
Thomas
P.S. Recognized your answer a little bit toooo late