Updated on 2024-06-28 GMT+08:00

Creating a Plug-in

You can customize a script to create a plug-in and use it to collect metric data.

Procedure

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane, choose Collection Management.
  3. In the navigation pane, choose Plug-in Market and click Create Plug-in.
  4. On the displayed page, set related parameters.

    • Plug-in information
      Table 1 Plug-in parameters

      Parameter

      Description

      Plug-in Name

      Name of a custom plug-in. Enter a maximum of 32 characters starting with a letter. Only letters, digits, and underscores (_) are allowed.

      Plug-in Type

      Type of a plug-in. The default value is Custom.

      Description

      Description of the plug-in to be created. Enter a maximum of 10,000 characters.

    • Plug-in configuration
      Table 2 Plug-in configuration parameters

      Parameter

      Description

      Plug-in Version

      Version number of the custom plug-in.

      Plug-in Script

      Custom plug-in script. Options: Linux and Windows.

      Linux: Shell or Python script.

      Example:

      #!/bin/bash
      #Examples
      echo "metric_name{label_name=\"label_value\"} 100"

      Windows: BAT script

      Example:

      ::Examples
      @echo off
      echo metric_name{label_name="label_value"} 100

      Default Script Parameter

      Custom script parameter template. Only letters, digits, and underscores (_) are allowed. The rules are as follows:

      • Letter: For example, -a.
      • Character combination: For example, http://10.0.0.1:80. The following special characters are not allowed: &|><;`!()$-
      • ${Parameter}: Enter a maximum of 64 characters starting with a letter. Only letters, digits, and underscores (_) are allowed. For example, ${a_b}.

      You can combine parameters as required and separate them with spaces. The total length of these parameters cannot exceed 250 characters.

      Script Parameter

      Parameters in the default script parameters. After you enter the default script parameters, the system automatically identifies script parameters based on your settings.

      Script parameter description:

      • Mandatory: If this option is enabled, the parameter value in the plug-in debugging area is mandatory. If this option is disabled, the parameter value in the plug-in debugging area is optional.
      • Parameter: name of a script parameter.
      • Default Value: default value of the script parameter.
      • Description: description of the parameter.

  5. Click Save.