collect_metric
Performs an immediate collection and threshold evaluation of a set of metrics associated with the specified internal metric name. Metric data collection and threshold evaluation occur asynchronously to the EM CLI call.
You typically use this command when you believe you have resolved an open metric alert or error and would like to clear the event by immediately collecting and reevaluating the metric. This command applies to most metrics except server-generated database metrics.
Use the get_on_demand_metrics verb to see a complete list of supported metrics for a given target.
Format
emcli collect_metric -target_name=name -target_type=type -metric_name=metric_name | -collection_name=user_defined_metric_name [ ] indicates that the parameter is optional
Options
-
target_name
Name of the target.
-
target_type
Internal target type identifier, such as host, oracle_database, and emrep.
-
metric_name
Internal name that represents a set of metrics that are collected together. Use the get_on_demand_metrics verb to see the supported list of metrics for a given target.
-
collection_name
Name of the metric extension. This option only applies to metric extensions.
Examples
Example 1
If you want to collect the "CPU Utilization (%)" metric, look for the appropriate metric internal name (which is Load) using the get_on_demand_metrics command, then run the command as follows:
emcli collect_metric -target_type=host -target_name=hostname.example.com -metric_name=Load
Example 2
This example immediately collects and evaluates thresholds for the metric extension called MyUDM:
emcli collect_metric -target_type=host -target_name=hostname.example.com -collection=MyUDM