Submit a ticketCall us

WebinarUpcoming Webinar: How Help Desk and Remote Support Pays for Itself

Learn how help desk software can simplify ticketing management, allow you to track hardware and software assets, and accelerate the speed of IT support and service delivery. Gain insights on how remote support tools allow your IT team to maximize their efficiency and ticket resolution by expediting desktop troubleshooting, ultimately helping keep end-users happy and productive.

Register here.

Home > Success Center > Network Performance Monitor (NPM) > 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