# WLOC Administration Console Online Help

# Define custom metrics to monitor

Before you begin

Review Monitor resources.

You can define and graph custom metrics as functions of monitorable resource attributes.

To define custom metrics to monitor

1. Click the Monitoring tab in the WLOC navigation bar.
2. Click the Custom tab in the Monitoring pane.
3. Click Add.
4. Set the custom metric properties, as described in the following table.

   Property | Description
   --- | ---
   Custom Metric Name | Name of the custom metric.
   Function | Function used for the custom metric (described below).
   Metric | MBean attribute or scalar values required by the specified function. The number of fields displayed depends on the function selected. Use the following format when entering MBean attributes: `[instance-type|instance-name|attribute-name]` Where: `instance-type`: MBean type. For example, `weblogic.management.runtime.ServerRuntimeMBean`. `instance-name`: Name of the MBean. For example: `com.bea:Name=ManagedServer1,Type=ServerRuntime`. For a collection, you might specify the name using a wildcard (*): `com.bea:Name=*,Type=ServerRuntime` `attribute-name`: Name of the MBean attribute. For example: `State`. If you want the metric to appy to multiple instances, you can specify `.*` for `instance-name`. For more information about the MBean attributes, see WebLogic Server MBean Reference. For example: `[weblogic.management.runtime.ServerRuntimeMBean|.*|RestartsTotalCount]` Note: Attributes with complex types are not valid for selection.
   Service Name | Name of the service for which the custom metric is collected.
   Process Group | Name of the process group for which the custom metric is collected. If Service Name is set to All Services, you can select All Process Groups only.
   Process Instance | Name of the process instance for which the custom metric is collected. If Process Group is set to All Process Groups, you can select All Instances only.

   The following table describes the functions that you can select.

   Property | Description
   --- | ---
   Abs(x) | Absolute value of the specified attribute.
   Difference(x, y) | Difference between two attributes (x-y).
   DifferenceWithScalar(x, s) | Difference between the specified attribute and a scalar value (x-s).
   HighModeOfCollection(c) | Highest value that occurs most frequently in the collection of attributes. For example, if the returned values are 1 2 3 3 4 5 5 6 7, the function returns 5.
   Inverse(x) | Inverse value of an attribute (1/x).
   LowModeOfCollection(c) | Lowest value that occurs most frequently in the collection of attributes. For example, if the returned values are 1 2 3 3 4 5 5 6 7, the function returns 3.
   Max(x) | Maximum observed value for the attribute.
   MaxOfCollection(c) | Maximum observed value for the collection.
   MeanOfCollection(c) | Statistical average observed value for the collection.
   MedianOfCollection(c) | Statistical median observed value for the collection.
   MinOfCollection(c) | Minimum observed value for the collection.
   Negative(x) | Negative value of the attribute.
   Over(x,s) | Upper threshold value (s) for specified attribute. If the value of x is greater than s, then the function returns 1. Otherwise, the function returns 0.
   OverMetric(x,y) | Upper threshold attribute value (y) for specified attribute. If the value of x is greater than s, then the function returns 1. Otherwise, the function returns 0.
   Product(x,y) | Product of the specified attributes (x*y).
   ProductWithScalar(x,s) | Product of the specified attribute and scalar values (x*s).
   Ratio(x,y) | Ratio of the specified attributes (x/y).
   RatioWithScalar(x,s) | Ratio of the speicifed attribute and scalar values (x/s).
   Size(c) | Number of values in the collection.
   StandardDeviationOfCollection(c) | Standard deviation of attributes in the collection.
   Sum(x,y) | Sum of the specified attributes (x+y).
   SummationOfCollection(c) | Sum of the collection of attributes.
   SumWithScalar(x,s) | Sum of the specified attribute and scalar values (x+s).
   Under(x,s) | Lower threshold value (s) for specified attribute. If the value of x is greater than s, then the function returns 1. Otherwise, tjhe function returns 0.
   UnderMetric(x,y) | Lower threshold value (y) for specified attribute. If the value of x is greater than s, then the function returns 1. Otherwise, the function returns 0.

5. Click Finish.

   The custom metric is created and added to the Custom pane.

6. Click the name of the custom metric on the Custom pane to add it to the current view.

   The chart is added using the preferences that are currently set. For information about setting preferences, see Set preferences for charts. If displayed, the legend identifies the monitorable type and resource for which the chart applies using the following format: `monitorabletype@resourcename`.

   If WLOC detects a problem with a selected chart, the following message is displayed within the body of the chart: `Problem detected`. View the events page and log files to troubleshoot the issue, as described in Monitor events and pending approvals and View and configure log and audit messages, respectively.

After you finish

Perform one or more of the following tasks, as required:

- Select resources to monitor
- Set preferences for charts