locked
SCOM SDK to create SCOM Alert on any object RRS feed

  • Question

  • Hi,

    We have one requirement to create SCOM Alert on some managed object from outside SCOM environment. Is there any SCOM SDK method to create SCOM Alert, . We are integrating SCOM to one of
    our product which needs to generate Alert from outside SCOM.

    Is there any way to create SCOM Alert from outside of SCOM environment? Please give me some
    example if any .

    I am looking for a programmatic way to do this task.

    Thanks,

    Abhi





    • Edited by barikabhi Wednesday, March 13, 2013 12:35 PM
    Wednesday, March 13, 2013 12:31 PM

Answers

All replies

  • Hi,

    Would you please let us know more details about your requirements?

    Please see if connector is what you need:

    Using Operations Manager Connectors
    http://msdn.microsoft.com/en-us/library/hh328935.aspx

    Thanks.


    Nicholas Li
    TechNet Community Support

    • Marked as answer by Nicholas Li Friday, March 22, 2013 4:42 AM
    Friday, March 15, 2013 8:56 AM
  • Hi, I'm trying to do the same thing. I've written a SCOM inbound connector which can insert/delete objects and can create events. However, I need to be able to create alerts programmatically (i.e. via the SDK). I have worked out how to query and resolve alerts using the SDK, but actually creating them has so far eluded me. 

    Surely there must be a way of doing this?

    Thanks in advance for any suggestions.

    Tuesday, November 4, 2014 2:12 PM
  • I have now got a working solution to this problem. For those who are interested, this is what I did.

    1. Generate events using the SDK as normal. This amounts to calling InsertCustomMonitoringEvent in the way shown in the example.

    2. Write a Rule in the management pack that uses the data source Microsoft.SystemCenter.SdkEventProvider and the writer System.Health.GenerateAlert. The rule should target the objects which you generate the events for.

    3. Add a condition detection module to the rule which filters on the EventLevel property. This means you must have 3 copies of the rule for Informational, Warning and Error type alerts. This allows you to map the EventLevel=1 -> Severity=2 (Error), EventLevel=2 -> Severity=1 (Warning), EventLevel=4 -> Severity=0 (Informational).

    You might also need to add a filter on the PublisherName of the event to map onto the correct Target object, using some unique key property of the $Target$.

    With all this in place you will of course be generating both events and alerts with the same content, but it does at least give you a working method of generating alerts using the SDK. Quite why they didn't add a Microsoft.SystemCenter.SdkAlertProvider type data source I don't know... That would've made life much easier.
    Monday, November 10, 2014 11:27 AM