Good Morning everyone, and thanks for all of the replies. HolyGuacamole and Leon Adato are corect I need to use a SQL variable.
I tried the one that Leon Adato recomended but that did not work.... So I watched the SolarWinds Lab #7 video and dug through a few more post that were linked from that video site and so far I have settled on an SQL variable that looks like. The SQL variable below almost works....
I tried with 2 curly braces at the end of the statement but that made the result look funny so I have removed on curly brace and the result looks OK...
Circuit Info: ${SQL:Select CircuitID From Interfaces WHERE Interfaces.NodeID = ${NodeID} AND CircuitID IS NOT NULL}
If the alert is tested with the above SQL statement the output looks like this....Circuit Number: 34.HCXX.98908..NW
Now if the same alert triggers and this node is a switch with no configured circuit number or carrier info The email body
will look like this....: Circuit Info: ${SQL:Select [CircuitID] From [dbo].[Interfaces] WHERE Interfaces.NodeID = $@NodeID@ AND [CircuitID] IS NOT NULL}... Not really what I want to happen... i would prefer that the line just stay blan if there is no value to show....
So it looks like i will need to create 2 alerts and add a new custom property for nodes. The two alerts will look exactly the same except one will have the SQL statements in it and the other will not. The new custom nodes field property will be a YES/NO on which alert alert to use. One of the alerts will have a new trigger condition added to test if the value is YES or NO....
If anyone knows of a way to stop the SQL statement from being displayed when the field is NULL I would greatly appreciate it...