1 Reply Latest reply on Apr 16, 2018 9:59 AM by jamesatloop1

    All Related Alerts Per Object Query

    Adam Stephen

      Hey Thwacksters,

       

      I was working the other day on a custom query resource that I wanted to present my users to show the related alerts to an object other than the built in one on Nodes only.  I wanted to have a resource that would show the related alerts on Applications, Components, Volumes, etc.  See the query below for the example also the screen shots of the results.  The basic Idea is not new how ever the secret sauce is the entitytype which I used to restrict the alerts to the object type.  The next issue is this works on all objects but the way the alerts are built the Alert objects table uses a term called relatednodeID as the reference tot he parent node object.  The query works fine on all objects except Orion.Nodes in which I only show the other alerts related.  Still working on the relationship I need to build for that.  Let me know if you have any questions.

       

       

       

      select

      a.name as [Alert Name]

      ,o.entitycaption as [Object]

      ,o.lasttriggereddatetime as [Last Occurrence]

      from orion.alertobjects o

      join orion.alertconfigurations a on a.alertid = o.alertid

      where a.enabled = 'True'

      and o.relatedNodeId = '7945'

      and o.entitytype = 'Orion.Interfaces'   ( Replace with the correct entity type and use () with and or to evaluate first if multiple entities types are required

      group by a.name