Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 7

SWSQL Report to show all nodes that are assigned to an alert

I need a report that shows me Active Alerts, there name and the Nodes that can be triggered by the Alert.

I have gotten this far can someone please assist?



Looking in [OrionDB][AlertObjetcs]                               

select EntityCaption from AlertOjects where alertid = '166'

Looking in [OrionDB][AlertConfigurations]

Select Name where alertiid = '166' and enabled = '1'





0 Kudos
1 Reply

What you have there will actually only be a list of objects that have already triggered that particular alert in the past.  Triggering an alert doesn't even reliably say that it could trigger the alert again in the future since the alert rules may be edited or the attributes of the node may change.  If i started out with a node down alert, but later on filter it to only nodes with a specific custom property then I can't really compare the list of nodes that matched the old logic against the new logic.  There is no way from the database to know which nodes *could* trigger an alert in the future as they don't map things across 1 to 1 in that way.  An alert isn't an object that you assign to a node that has some kind of static relationship, every time the alert checks against the DB is just runs a SQL query against the whole table with a list of WHERE conditions based on your rules. Any node that matches the condition at that time will trigger the alert, but the tool doesn't know ahead of time which nodes might match because you could change any number of things in the rule or on the node itself.  Unfortunately this is a common request, but the way the alerting engine works is incompatible with generating a list like that.   When I get people trying to get those lists I have usually just told them that here is the list of alerts, all nodes are potentially able to trigger all of these alerts if they meet the conditions and let it go at that.

- Marc Netterfield, Github