Is it possible to use canned Orion variables, such as ${ComponentID}, inside of a SQL statement that you are using for an email alert? I've tried it a couple of different ways, but it doesn't return any results. Any help would be much appreciated.
You can in both the Subject and the Message. The only problem I've had so far is with the quotation marks. For example:
${SQL:Select NodeID from Nodes where RelatedInfo like '%N:${NodeID}''%'}
What does your SQL Variable look like?
david,
The statement dave is using looks like this:
${SQL: SELECT PortEvi.ErrorMessage FROM APM_PortEvidence PortEvi JOIN APM_CurrentComponentStatus ccs on ccs.ComponentStatusID = PortEvi.ComponentStatusID WHERE ccs.ComponentID = ${ComponentID}}
The only difference I see is you have '%N: variable "%'
I am not familiar with the %N info.
This has been resolved: Below is the new line.
Alert: The ${ComponentName} on ${NodeName} is: ${SQL: SELECT PortEvi.MinStatisticData FROM APM_PortEvidence PortEvi INNER JOIN APM_CurrentComponentStatus ccs on ccs.ComponentStatusID = PortEvi.ComponentStatusID WHERE ccs.ComponentID= '${ComponentId}'}
I am now querying the correct column in portevidence (PortEvi.MinStatisticData ) as well as the single quotes around the variable name ( '${ComponentId}'). I also changed from Join to Inner Join, not sure if this made a difference or not.
The N: is within the text field. I'm using it with the wildcards to match up things correctly. You wouldn't need it.
I'm glad you got it working!