Question1: What dictates whether #fieldname# or scope.get('fieldname') should be used when defining a variable to be used in a rule from one of the fields in a table?
Question2: How do you determine whether a field is a metric type?
Answer1:
Use the #fieldname# syntax when the field is a metric type. When the field is not a metric type, or you are referencing other topology objects use scope.get("name") to define the variable.
#fieldname# is a query for metric and observation values.
scope.get("name") is the way to get the value of topology object attributes that are not metrics.
Answer2:
The entries in the tree underneath the table for an agent (Configuration | Data | Foglight | All Agents | [agent] | Tables | [table name] ) are metrics, so you would use the #metricname# syntax in your rule for the fields you find here.
To get a list of properties associated with a table you can highlight the table (Configuration | Data | Foglight | All Agents | [agent] | Tables | [table name] ) and then select PropertyViewer under the General tab of the Action panel (on the right hand side of the console). You can use the "scope.get()" function to define a variable from a property.
Please see the screen shots in the attached file (check_field_type.doc)
© ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center