This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

${SQL:Select ....} in alert message - translates for one components, shows txt in another

Hey all,

trying to send email alerts w/ meaningful info for template critical thresholds met.

Same alert for different components...translates properly

Threshold Settings (if set):
Name: Response
PollFrequency: 60

Critical Threshold: 3500

3 out of 3 polls.

This one didn't...NOTICE the internal '{' and '}' got replaced w/ @ signs

Threshold Settings (if set):
Name: ${SQL:select (isNULL(ThresholdName,'')) from APM_Threshold where ID=$@ComponentID@}
PollFrequency: ${SQL:select (isnull(apps.Value,ats.Value)) from APM_Component c WITH (NOLOCK) left join APM_ComponentTemplate ct WITH (NOLOCK) on c.templateid=ct.id left join APM_ApplicationTemplateSetting ats WITH (NOLOCK) on ct.ApplicationTemplateID=ats.ApplicationTemplateID left join APM_ApplicationSetting apps WITH (NOLOC K) on c.ApplicationID=apps.ApplicationID where c.ID=$@ComponentID@ and ats.[Key] like '%[_][_]Frequency%' and (apps.[Key] like '%[_][_]Frequency%' or apps.[Key] is null)}

Critical Threshold: ${SQL:select (isNULL(Critical,'')) from APM_Threshold where ID=$@ComponentID@}

${SQL:select (isNULL(criticalPolls,'')) from APM_Threshold where ID=$@ComponentID@}
out of ${SQL:select (isNULL(criticalPollsInterval,'')) from APM_Threshold where ID=$@ComponentID@} polls.


anyone have any thoughts?

  • figured it out.

    basically, there was an empty set...i.e. no table entry.  resolved by using this:

    Name: ${SQL:select (isnull(t.ThresholdName,'Not Set'))  from APM_Component c left join APM_Threshold t on c.id=t.id where (c.ID=11376 OR c.ID is null)} 

    AND

    PollFrequency: ${SQL:select (isnull((isnull(apps.Value,ats.Value)),'Not Set')) from APM_Component c WITH (NOLOCK) left join APM_ComponentTemplate ct WITH (NOLOCK) on c.templateid=ct.id left join APM_ApplicationTemplateSetting ats WITH (NOLOCK) on ct.ApplicationTemplateID=ats.ApplicationTemplateID left join APM_ApplicationSetting apps WITH (NOLOCK) on c.ApplicationID=apps.ApplicationID where c.ID=${ComponentID} and (ats.[Key] like '%[_][_]Frequency%' or ats.[key] is null) and (apps.[Key] like '%[_][_]Frequency%' or apps.[Key] is null)}

  • njoy,

    glad you figured it out.

    Do you mind explaining what scenario this alert would be useful in?

  • I use this for template based component checks.  basically, you can set thresholds to x of y polls, etc..allowing you to delay the trigger and/or ensure really an issue.

    it got tricky because you have the main template and then you have the application monitor (applied to system) which can override template.

    This allows the alert to spell out what they've got set for that component check for that system (if they've customized or have set that x out of y polls feature), in essence, telling them how long the condition has actually existed when the alert triggered.