Creating Repository-side Metric Extensions
Beginning with Enterprise Manager Release 12.1.0.4, you can create repository-side metric extensions. This type of metric extension allows you to use SQL scripts to extract information directly from the Enterprise Manager repository and raise alerts for the target against which the repository-side extension is run. For example, you can use repository-side metric extensions to raise an alert if the total number of alerts for a host target is greater than 5. Or perhaps, raise an alert if the CPU utilization on that host is greater than 95% AND the number of process running on that host is greater than 500. Repository-side metrics allows you to monitor your Enterprise Manager infrastructure with greater flexibility.
To create a repository-side metric:
- From the Enterprise menu, select Monitoring, then select Metric Extensions.
- From the Create menu, select Repository-side Metric Extension. Enterprise Manager will determine whether you have the Create Extension privilege and guide you through the creation process.
- Decide on a target type and metric extension name. Be aware that the name (and Display Name) must be unique across a target type.
- Enter the general parameters.
Collection Schedule
You defined the frequency with which metric data is collected and how it is used (Alerting Only or Alerting and Historical Trending) by specifying collection schedule properties.
- Create the SQL query to be run against the Enterprise Manager Repository. Explicit instructions for developing the query as well as examples are provide on the SQL Query page.
Click Validate SQL to test the query.
If you already have a SQL script, you can click Upload to load the SQL from an external file.
- From the Columns page, you can view/edit columns returned by the SQL query. You may edit the columns, however, you cannot add or delete columns from this page.
-
Column Type
A column is either a Key column, or Data column. A Key column uniquely identifies a row in the table. For example, employee ID is a unique identifier of a table of employees. A Data column is any non-unique data in a row. For example, the first and last names of an employee. You can also create rate and delta metric columns based on an existing data column. See Rate and Delta Metric Columns below.
-
Value Type
A value type is Number or String. This determines the alert comparison operators that are available, and how Enterprise Manager renders collection data for this metric column.
-
Alert Thresholds
The Comparison Operation, Warning, and Critical fields define an alert threshold.
-
Alert Thresholds By Key
The Comparison Operation, Warning Thresholds By Key, and Critical Thresholds By Key fields allow you to specify distinct alert thresholds for different rows in a table. This option becomes available if there are any Key columns defined. For example, if your metric is monitoring CPU Usage, you can specify a different alert threshold for each distinct CPU. The syntax is to specify the key column values in a comma separated list, the "=" symbol, followed by the alert threshold. Multiple thresholds for different rows can be separated by the semi-colon symbol ";". For example, if the key columns of the CPU Usage metric are cpu_id and core_id, and you want to add a warning threshold of 50% for procecessor1, core1, and a threshold of 60% for processor2, core2, you would specify: procecessor1,core1=50;processor2,core2=60
-
Manually Clearable Alert
Note:
You must expand the Advanced region in order to view the Manually Clearable Alert option.
If this option is set to true, then the alert will not automatically clear when the alert threshold is no longer satisfied. For example, if your metric is counting the number of errors in the system log files, and you set an alert threshold of 50, if an alert is raised once the threshold is met, the alert will not automatically clear once the error count falls back below 50. The alert will need to be manually cleared in the Alerts UI in the target home page or Incident Manager.
-
Number of Occurrences Before Alert
The number of consecutive metric collections where the alert threshold is met, before an alert is raised.
-
Alert Message / Clear Message
The message that is sent when the alert is raised / cleared. Variables that are available for use are: %columnName%, %keyValue%, %value%, %warning_threshold%, %critical_threshold%
You can also retrieve the value of another column by surrounding the desired column name with "%". For example, if you are creating an alert for the cpu_usage column, you can get the value of the core_temperature column by using %core_temperature%. Note that the same alert / clear message is used for warning or critical alerts.
Note:
Think carefully and make sure all Key columns are added, because you cannot create additional Key columns in newer versions of the metric extension. Once you click Save As Deployable Draft, the Key columns are final (edits to column display name, alert thresholds are still allowed). You can still add new Data columns in newer versions. Also be aware that some properties of existing Data columns cannot be changed later, including Column Type, Value Type, Comparison Operator (you can add a new operator, but not change an existing operator), and Manually Clearable Alert.
-
Metric Category
The metric category this column belongs to.
-
Add Delta metric columns based on another metric column
Example: You want to know the difference in the table space used since the last collection.
Delta Calculation:
current metric value - previous metric value
-
Add Rate Per Minute metric column based on another metric column
Example: You want to know the average table space usage per minute based on the table space column metric which is collected every 1 hr.
Rate Per Minute Calculation:
(current metric value - previous metric value)/ collection schedule
where the collection schedule is in minutes.
-
Add Rate Per Five Minutes metric column based on another metric column
Example: You want to know the average table space usage every five minutes based on the table space column which is collected say every 1 hour]
Rate Per Five Minute Calculation:
[(current metric value - previous metric value)/ collection schedule ] * 5
where the collection schedule is in minutes.
To create a rate/delta metric column, click on an existing data column in the table and then select one of the rate/delta column options from the Add menu.
-
- From the Test page, add available test targets.
- Click Run Test to validate the metric extension. The extension is deployed to the test targets specified by the user and a real-time collection is executed. Afterwards, the metric extension is automatically undeployed. The results and any errors are added to the Test Results region.
- Repeat the edit /test cycle until the metric extension returns data as expected.
- Click Finish.