Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how do I obtain target from SDK?

2 views
Skip to first unread message

Rex

unread,
Feb 18, 2008, 11:41:01 AM2/18/08
to
I am in the process of developing a custom connector to forward alerts to an
external system. I have the extraction process working but am having
difficulty obtaining two attributes related to alerts that I need to export
to the external system. (I am looking for two data items and each has its own
post here. This is the first one.)

Does anyone know how to access the target of an alert using C# and the SCOM
SDK?

In the SCOM GUI console this is obtained by selecting an alert under
Monitoring and then clicking on either the “Alert Rule” or the “Alert
Monitor” under the “Alert Details” pane. From the properties window that pops
up, I am looking for the “Rule target” or the “Monitor target” field.

I tried the following code which seemed like the obvious solution, but I
find that the name property on the target object is null. There is a guid in
the id property of the target object, but I don’t know how to translate it or
even if it is the data I am looking for.

if (alert.IsMonitorAlert)
{
ManagementPackMonitor mon = mg.GetMonitor(alert.MonitoringRuleId);
target_name = mon.Target.Name;
}
else
{
MonitoringRule rule = mg.GetMonitoringRule(alert.MonitoringRuleId);
target_name = rule.Target.Name;
}

Thanks

Jakub Oleksy [MSFT]

unread,
Feb 27, 2008, 3:16:07 PM2/27/08
to
On the target you actually want to call GetElement().Name. The Target is a
ManagementPackElementReference.

--
Jakub Oleksy
Developer
Blog: http://blogs.msdn.com/jakuboleksy/
Log a bug or Feature Request directly to the SCOM Product Team by going to
http://connect.microsoft.com/site/sitehome.aspx?SiteID=209. This posting is
provided "AS IS" with
no warranties, and confers no rights.


"Rex" <R...@discussions.microsoft.com> wrote in message
news:5F477EF5-8F93-4DFD...@microsoft.com...

0 new messages