You can enhance your super metrics by using clauses and resource entry aliasing.

The where clause verifies whether a particular metric value can be used in the super metric. Use this clause to point to a different metric of the same object, such as where = "metric_group|my_metric > 0.

For example: count(${adaptertype = ExampleAdapter, objecttype = ExampleObject, metric = ExampleGroup|Rating, depth=2, where = "==1"})

Resource entries are used to retrieve metric data from vRealize Operations Manager for computing super metrics. A resource entry is the part of an expression which begins with $ followed by a {..} block. When computing a super metric, you might have to use the same resource entry multiple times. If you have to change your computation, you must change every resource entry, which might lead to errors. You can use resource entry aliasing to rewrite the expression.

The following example, shows a resource entry that has been used twice.

(min(${adapterkind=VMWARE, resourcekind=HostSystem, attribute= cpu|demand|active_longterm_load, depth=5, where=”>=0”}) + 0.0001)/(max(${adapterkind=VMWARE, resourcekind=HostSystem, attribute=cpu|demand|active_longterm_load, depth=5, where=”>=0”}) + 0.0001)"

The following example shows how to write the expressing using resource entry aliasing. The output of both expressions is the same.

(min(${adapterkind=VMWARE, resourcekind=HostSystem, attribute= cpu|demand|active_longterm_load, depth=5, where=”>=0”} as cpuload) + 0.0001)/(max(cpuload) + 0.0001)"

Follow these guidelines when you use resource entry aliasing:

When you create an alias, make sure that after the resource entry you write as and then alias:name. For example: ${…} as alias_name.

The alias cannot contain the ()[]+-*/%|&!=<>,.?:$ special characters, and cannot begin with a digit.

An alias name, like all names in super metric expressions, is case-insensitive.

Use of an alias name is optional. You can define the alias, and not use it in an expression.

Each alias name can be used only once. For example: ${resource1,…} as r1 + ${resource2,…} as R1.

You can specify multiple aliases for the same resource entry. For example: ${…} as a1 as a2.

You can use a ternary operator in an expression to run conditional expressions.

For example: expression_condition ? expression_if_true : expression_if_false.

The result of the conditional expression is converted to a number. If the value is not 0, then the condition is assumed as true.

For example: -0.7 ? 10 : 20 equals 10. 2 + 2 / 2 - 3 ? 4 + 5 / 6 : 7 + 8 equals 15 (7 + 8).

Depending on the condition, either expression_if_true or expression_if_false is run, but not both of them. In this way, you can write expressions such as, ${this, metric=cpu|demandmhz} as a != 0 ? 1/a : -1. A ternary operator can contain other operators in all its expressions, including other ternary operators.

For example: !1 ? 2 ? 3 : 4 : 5 equals 5.