For a DBSS rule, the Customer created a CommandAction and a severity Level Variable for the Critical condition of a rule.
The Severity Level Variable (host) was created to resolve the host name as was defined as the expression: scope.get("monitoredHost/name")
This variable was then referenced in another Severity Level Variable called pagetxt (defined as a message).
This expression was tested in the 'Run Condition Query' and it resolved as expected.
However, when the command action was triggered, the customer received this as the command action result.
%:Notify:Page:DBA.Sup.MS.SQL:% SQL Server Agent service is down on scope.get(monitoredHost/name).
How can the Host name be resolved for this host?
There are two ways to try to work around this issue:
- Define the variable at the rule level under "Rule Variables"
- Convert "pagetxt" (that references the host severity level variable) to an expression (versus a message).
You may need to enclose the literal text in single quotes to make sure it's not interpreted as a script, something like this:
'%Notify:....' + @host
'%Notify:....' + scope.get("monitoredHost/name")
Also see edocs on topic About rule-level and severity-level variables in rule expressions