Show TOC

Procedure documentationCreating a Custom Metric Locate this document in the navigation structure

 

To define the metrics based on the data provided by your custom script, define a custom template.

Prerequisites

  • You have the required authorization.

  • Optional: You have created a custom alert to which you want to assign the new metric.

Procedure

  1. Start the Custom Metric Creation Wizard:

    1. In the SAP Solution Manager Configuration work center, choose the Technical Monitoring scenario.

    2. Under Technical Monitoring, select the System Monitoring guided procedure.

    3. Go to the Template Maintenance step.

    4. Choose Edit.

    5. Under Templates, select a template type for the type of object you want to monitor. For example, to monitor the Java stack of an SAP installation, under Technical Instance, select an SAP J2EE template.

    6. Choose the Expert Mode pushbutton.

    7. Choose the Create Custom Template pushbutton.

      A template is created.

    8. On the Template Settings tab page, enter data as required.

    9. Choose the   Create   Metric   pushbutton.

      You go to the Custom Metric Creation Wizard.

  2. On the Overview tab page, enter data as required.

  3. On the Data Collection tab page, assign the Remote OS Script data provider:

    1. Specify a collection interval.

    2. In the Data Collector field, select Diagnostic Agent (push).

    3. In the Data Provider field, select Remote OS Script.

    4. Specify the following parameter values:

      • SCRIPT: Enter the name of your custom script (OS command), for example ping.bat.

      • OPTION: Optional: enter a string value for command options, for example -W <timeout value>.

      • RETURN_TYPE: Specify the data type. The default parameter is String.

    5. Optional: To fix a parameter value and prevent the parameter from being edited, deselect the Configure checkbox. For example, to prevent the metric being assigned to another script, you would fix the value of the script parameter containing the name of the script.

  4. Specify the metric attributes as required, and choose Next.

    The data provider uses the MAI structure: The rated, numeric, and text fields of this structure are used depending on the type of threshold chosen.

    The way the data provider fills this structure depends on the return type:

    • Numeric: The numeric and text fields of the MAI structure are filled with the script result value.

    • String: The text field of the MAI structure is filled with the script result value.

    • Numeric/String: The rated field of the MAI structure is filled depending on the script exit code which is set to green or red, depending on the script execution exit code (0 equals green rating and any other exit code equals red rating).

    In any case, the text field is filled with the error and/or result value(s).

    Depending on the script results, you can use different thresholds. For example, the Already rated threshold type uses the rating field, the numeric thresholds use the numeric fields, and the text thresholds use the text field.

  5. If you have created a custom alert, assign the metric to the alert and finish the Custom Metric Creation Wizard.

  6. To assign the template to the managed object, in the System Monitoring guided procedure, go to the Define Scope step and enter data as required.

  7. To activate the template, in the System Monitoring guided procedure, go to the Set up Monitoring step and enter data as required.