I got an alert setup for a single node but want to include a variable from another node that is not included in the email alert. I have mapped out the Universal Device Poller to trigger an alert when DC-UPS1 goes on battery. Alert works fine. I need to add the variables from DC-UPS2 which is a different node. The email will be formatted something like this:
Time left on DC-UPS1: ### minutes
Time left on DC-UPS2: ### minutes
Here is the SQL that I pulled from a 9-year-old Thwack post by Dhanson which works great on the alerting node. I even R&D (rip-off and duplicate) it and used it to pull other variables for many other alerts needing Universal Device Poller.
Time left on DC-UPS1: ${SQL:SELECT [c].Status FROM [dbo].[CustomPollers] AS [a],[dbo].[CustomPollerAssignment] AS [b],[dbo].[CustomPollerStatus] AS [c] WHERE [a].CustomPollerID = [b].CustomPollerID AND [b].CustomPollerAssignmentID = [c].CustomPollerAssignmentID AND [a].UniqueName LIKE '%BatteryTimeRemaining%' AND [b].NodeID = '${NodeID}'} minutes
Time left on DC-UPS2: I could not figure out. I tried adjusting [b].NodeID = '${NodeID}' by swapping from b to z and entering in the name of the node which is DC-UPS2 but keeps erroring out. I tried a few other methods of R&D along with Google-foo and digging around Thwack.
To give a better idea why I am asking this is because the same source runs both DC-UPS1 and 2. If Power Company is out, then both UPSes have lost power. We then keep our fingers and toes crossed, hoping the generators kick in (they work great during testing, just not when needed). Sysops does not want to get SPAMed with alerts during a potential crisis and have to look at two alerts for numbers they have to compare and keep track of.
Any ideas or shoves in the right direction is helpful.