I need to populate an advanced alert email with data from another table in the database. For example, I have an advanced alert on a custom MIB poller for an APC UPS. This alerts when the temp gets over 85 degrees in an IDF. When it triggers, I want it to send an email that says "IDF b28-1 is 87 Degrees" where "b28-1" is a value in ${Nodes.Closet} and the "87" is stored in ${CustomPollerStatus.Rate}
I can only seem to access data in the table holding the data that was alerted on.
How can I pull data from a different table in the database?
Assuming closet is set up as a custom property Try ${SQL: select Closet from Nodes where NodeID = ${NodeID}} instead of ${Nodes.Closet}
For a non-custom property like 'Location' you can use ${Node.Location}.
I have tried the above mentioned SQL variable and wasn't able to get this to work. For some reason, It did not like the embedded variable within the SQL variable and never worked. I created a custome property for each node called Service and was able to access this field from within the email message using ${Node.Service}. Even though this field was in the Nodes (plural) table, I was only able to access this value using the Node.Service macro variable. If Closet is a custom property on Nodes, I would try ${Node.Closet} (singular) in the message.
The SQL macro should work. I use it all the time. Make sure that you are including the colon and have a closing curly brace for each opening curly brace.
This actually works!
I am running a SQL query in 8.5 and it is only returning the first result. Is anyone else experiencing this?
It is designed to only return the first record in the dataset. You should use the where clause to filter to the object you want. If you are interested in the number of records you would get you can get the count(*).
Have you ever used a custom property within a Advanced Alert Trap??? I have created a custom Trap for Advanced Alerts and would like to include a custom Property field.