
Using the Query Language 481
Using the Query Language in Rule Conditions or Derived Metric Expressions
Expressions must be specified using the query language, and the syntax
@expressionName must be used to reference expressions in messages.
Tip If you want to include an email address in a message, simply use the @ symbol twice. For
example:
Send email to administrator@@example.com
Note The expressions that you can reference in a message vary depending on the scope of the
message. See Chapter 6, “Adding severity-level variables” on page 256 for details.
You can also reference registry variables in expressions using the syntax
registry("registryVariableName").
Examples
• You are editing a simple rule that is scoped to the topology type
JVM; the
condition for the rule is
#threads_started#>10. You want to create a message
(to use as the text of the email that is sent when the rule fires) that includes the
value of the
#threads_started# metric at the time when the rule fires.
Using the controls on the Severity Level Variables tab of the Fire tab, you create
an expression called
threadsNum whose value is #threads_started#. You
then create a message called
ProblemSynopsis. The value that you set for this
message is:
Threads started count is too high: @threadsNum
In this message, the at sign ‘@’ is used to reference the threadsNum expression.
When the message shown above is included in the email,
@threadsNum will be
replaced by the number of threads that were started at the time when the rule
fired.
• There is a registry variable called
CPUFatal whose value is 90 for the topology
object to which the rule you are editing is scoped. You want to reference this
variable in the alarm message for the rule’s Fatal severity level, so you create an
expression called
CPU whose definition is registry("CPUFatal"). You then
reference this expression in the rule’s alarm message:
CPU usage is at
@CPU%
.
Specifying a Rule Condition or Derived Metric Expression
vFoglight provides controls above the Condition field (for a rule) or the Expression
field (for a derived metric) that allow you to insert elements into the condition or
Kommentare zu diesen Handbüchern