I have a table at OID 184.108.40.206.4.1.2620.500.9002.1
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.
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 -- WHERE NodeID NOT IN ( SELECT DISTINCT NodeID FROM Orion.NPM.CustomPollerStatusOnNodeTabular WHERE CustomPollerStatusOnNodeTabular.CustomPollerAssignment.CustomPollerName = 'CUSTOMPOLLERNAME' AND Status = 'THE_VALUE_YOU_WANT_TO_ALARM_ON' ) 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 = '220.127.116.11.4.1.2620.500.9002.1'
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.
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 150,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process. Learn more today by joining now.