none
Updating alerts in connector

    Question

  • Hi!

    When developing outbound connector the only mean to change some properties of alert (e.g. set TicketId, change resolution state etc) is Update method of MonitoringAlert class object as far as I can see.

    Updating some alert properties this method also is updating the LastModifiedByNonConnector property according to MSDN.
    The description of the property: "Gets the last time, in DateTime format, the alert was modified by something other than a connector."
    So when my connector updates alert in code with Update method scom will consider it "something other than a connector".

    I wonder what then is "Connector" that can update alerts without affecting LastModifiedByNonConnector?
    This property could help to filter out alerts updated by connector itself and accept only actually changed alerts.

    Thanks

    Tuesday, April 04, 2017 12:23 PM

Answers

  • Think I've found what is the problem.

    MSDN reference states about MonitoringAlert.Update(String, MonitoringConnector) https://msdn.microsoft.com/en-us/library/hh331903.aspx:
    "Performing an Update modifies the LastModified property of the alert to the current time, LastModifiedBy property to the name of the user who performed the update, and modifies the LastModifiedByNonConnector to the current time."

    Seems to be an error in documentation: on the one hand this method is intended to update alerts for connector, on the other hand the docs says "it modifies the LastModifiedByNonConnector to the current time".

    I've checked the internals of Microsoft.EnterpriseManagement.OperationsManager.dll assembly and found a check is performed in internal Update method like this

    if (!modifyingConnectorId.HasValue)
     monitoringAlert.alertGenerated.LastModifiedByNonConnector = monitoringAlert.alertGenerated.LastModified;
    

    which confirms that LastModifiedByNonConnector is not updated when MonitoringConnector (modifyingConnectorId) parameter is supplied.

    • Marked as answer by Roman Annenko Friday, April 21, 2017 2:22 PM
    Friday, April 21, 2017 2:22 PM

All replies

  • Hello,

    As far as I am concerned, LastModifiedByNonConnector indicates whether the last modification was performed by a non-connector.

    Quote from:

    https://technet.microsoft.com/en-us/library/gg440814.aspx

    Regards,

    Yan Li


    Please remember to mark the replies as answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, April 20, 2017 5:44 AM
    Moderator
  • Hello,

    Yes, but question was about what is the misterious "Connector" that can update alert and not touch LastModifiedByNonConnector ?

    I woud like to act similarly from my connector code - update alert as "Connector", but I cant find method to do it. The only available method MonitoringAlert.Update changes both LastModified and LastModifiedByNonConnector properties.

    Thursday, April 20, 2017 6:54 PM
  • Think I've found what is the problem.

    MSDN reference states about MonitoringAlert.Update(String, MonitoringConnector) https://msdn.microsoft.com/en-us/library/hh331903.aspx:
    "Performing an Update modifies the LastModified property of the alert to the current time, LastModifiedBy property to the name of the user who performed the update, and modifies the LastModifiedByNonConnector to the current time."

    Seems to be an error in documentation: on the one hand this method is intended to update alerts for connector, on the other hand the docs says "it modifies the LastModifiedByNonConnector to the current time".

    I've checked the internals of Microsoft.EnterpriseManagement.OperationsManager.dll assembly and found a check is performed in internal Update method like this

    if (!modifyingConnectorId.HasValue)
     monitoringAlert.alertGenerated.LastModifiedByNonConnector = monitoringAlert.alertGenerated.LastModified;
    

    which confirms that LastModifiedByNonConnector is not updated when MonitoringConnector (modifyingConnectorId) parameter is supplied.

    • Marked as answer by Roman Annenko Friday, April 21, 2017 2:22 PM
    Friday, April 21, 2017 2:22 PM