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

Alert on table row exists

I have a table at OID

I want to be able to alert when a row is removed from the table, is this possible?

So for instance, trigger alert if row containing X value, does not exist.

0 Kudos
2 Replies
Level 8

Bit rubbish this community thing isn’t it!
Lazy money saving vendor trying to make their customers do the work, not even a moderator to assist and keep things ticking along it seems.
0 Kudos

This isn't a common request that many people would have experience with, and those of us that would may miss the thread or don't have the time to respond outside of their actual day jobs..

That said, here is a starting point without having access to your system or knowing the entire use case. You'll most likely need to customise the below based on the OID values, etc.

1. Create a new alert with type Custom SWQL Alert with a Node condition.

I am using a node condition assuming you are using a node poller and want to know which node is missing a row in that UnDP. If I used the Custom Table Poller Current Status condition, it alerted on every single row that didn't match.





2. The alert will prefill the initial SELECT line but you can add the remaining query into the text box:



SELECT Nodes.Uri, Nodes.DisplayName FROM Orion.Nodes AS Nodes

-- copy from here --

FROM Orion.NPM.CustomPollerStatusOnNodeTabular
WHERE CustomPollerStatusOnNodeTabular.CustomPollerAssignment.CustomPollerName = 'CUSTOMPOLLERNAME'
AND Nodes.CustomPollerAssignmentOnNode.CustomPollerName = 'CUSTOMPOLLERNAME'




It works in a bit of reverse logic. It looks for all the nodes that have that custom poller assigned and has that value. It then feeds that list to the outer SELECT query excluding those nodes.

If you don't want to use the CustomPollerName you can use the OID by replacing CustomPollerName with CustomPollerOID and then inputting the OID instead of the UnDP name.


WHERE CustomPollerStatusOnNodeTabular.CustomPollerAssignment.CustomPollerOID = ''


3. I haven't fulled looked into the reset condition. You might be able to use "when trigger condition is no longer true", or use the same custom query but with "WHERE NodeID IN" instead of NOT IN, or you may need to rewrite the entire query...


That should get you started. I recommend downloading the SolarWinds SDK and using the SWQL Studio to test your queries.