Submit a ticketCall us

AnnouncementsChange Is Inevitable

Get valuable help when it comes to tracking and monitoring changes. SolarWinds® Server Configuration Monitor (SCM) is designed to help you: detect, track, and receive alerts when changes occur, correlate system performance against configuration changes, compare server and application configuration against custom baselines, and verify application and system changes.

Learn more.

Home > Success Center > Network Performance Monitor (NPM) > NPM - Knowledgebase Articles > SQL or SWQL variable displayed in alert or syntax error in simulation

SQL or SWQL variable displayed in alert or syntax error in simulation

Updated November 2, 2017

Overview

This article discusses situations with custom alert variables where the SQL or SWQL does not display a resolved value.  
The error message "SQL MACRO error" can also appear

Environment

  • NPM, all versions
  • SAM, all versions

Detail

When building an alert action, it is possible to write SQL or SWQL to get a value that would be inserted into the action.  The SQL or SWQL could include the use of a SWIS variable that does resolve correctly, however the SQL/SWQL query still shows the query instead of the result of the query.

 

Situation #1

When simulating the action, it is possible to get "invalid syntax". Yet when the alert is triggered, the command resolves to a value. 

 

This is usually due to a variable in the query that would not have a valid value during the simulation, but would have a valid value when the alert was triggered.

Situation #2

When simulating or executing a custom SQL/SWQL query, the actual SQL/SWQL query is displayed, instead of resolving the query. 

 

This happens because the query cannot be resolved. For instance, the query resolves to no results or the query contains an invalid table.

Situation #3

The custom variable works in Trigger Actions, but does not work when used in Reset Actions. 

 

This could be because the tables being queried are only available during the Trigger Action and not available during Reset Action. For instance, the custom SQL/SWQL query is going against the AlertActive  table during the Trigger Action. In Reset Action, one cannot reference the AlertActive table.

Situation #4

When simulating or executing the alert, the SQL (and not SWQL) returns a SQL MACRO ERROR.  If you are on Orion 2017.3, please ensure that you have Hotfix 3 applied.

 

 

Last modified

Tags

Classifications

Public