Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Custom Plug-in Access

Updated on 2024-10-23 GMT+08:00

Application Scenario

Use a custom plug-in to create a collection task to monitor specified metrics. In addition, use Exporter to report database metrics for exception detection and Grafana dashboard display.

Prerequisites

Creating a Custom Plug-in

UniAgent allows you to create custom plug-ins. You can create a plug-in using scripts and create a collection task to use this plug-in by referring to Custom Plug-in Access to collect metrics.

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane, choose Access Center.
  3. In the Custom Prometheus Plug-in Access panel, click Custom 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.

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

      Parameter

      Description

      Plug-in Version

      Version 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. Ensure that the following rules are met:

      • Letter: For example, -a.
      • Character combination: For example, http://127.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.

    After a plug-in is created, you can modify it, create a version for it, or delete it.

    Table 3 Related operations

    Operation

    Description

    Checking the plug-in status

    Locate the target plug-in, hover the mouse pointer over the plug-in, and choose > Version. On the page that is displayed, check the plug-in status.

    • Unreleased: When you create a plug-in or create a plug-in version, the plug-in status is Unreleased. You can click the version number to edit the plug-in.
    • Released: After you click Release in the Operation column, the plug-in status changes to Released. You can click the version number to view the plug-in details.

    Creating a version

    Locate the target plug-in, hover the mouse pointer over the plug-in, and choose > Version. Click Create Version. On the displayed page, set the plug-in information.

    NOTE:
    • A maximum of five versions can be created for a plug-in.
    • If there is only one plug-in version, only Copy is available in the Operation column. If there is more than one plug-in, both Copy and Delete are available in the Operation column. You can click Delete to delete a plug-in version.

    Modifying a plug-in

    Locate the target plug-in, hover the mouse pointer over the plug-in, and choose > Modify. On the displayed page, modify the plug-in information.

    Deleting a plug-in

    Locate the target plug-in, hover the mouse pointer over the plug-in, and choose > Delete. On the displayed page, click Yes to delete the plug-in.

    NOTE:

    If a collection task has been configured for a plug-in, deleting the plug-in will also delete the collection task.

Custom Plug-in Access

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane on the left, choose Access Center. Click the custom plug-in on the Custom Prometheus Plug-in Access panel.
  3. On the collection task configuration page, set parameters by referring to the following table.

    Figure 1 Configuring a collection task
    Table 4 Parameters for creating a collection task

    Operation

    Parameter

    Description

    Select Instance

    Prometheus Instance

    Select a Prometheus instance for ECS to store collected data.

    A collection task will be associated with the Prometheus instance to mark and classify collected data. If no Prometheus instance is available, create one.

    Set Plug-in

    OS

    Operating system of the host. Options: Linux and Windows. For a custom plug-in, the OS is automatically selected.

    Collection Plug-in

    (Default) Created custom plug-in.

    Plug-in Version

    Select a plug-in version.
    NOTE:

    Plug-in versions that have not been released are dimmed and cannot be selected.

    Set Collection Task

    Collection Task Name

    Name of a collection task. Enter 1 to 50 characters and start with a letter. Only letters, digits, underscores (_), and hyphens (-) are allowed.

    Host

    Click Add Host and select a host.

    Specify host: Select a host that has been connected.

    • On the Specify host page, search for and select a host by the host name, IP address, or Agent status.
    • On the Specify host page, click in the upper right corner to deselect the host.
    • Ensure that the UniAgent of the selected host is running. Otherwise, no data can be collected.
    NOTE:

    If you select a custom plug-in, you can select multiple hosts.

    Advanced Settings

    Includes Collection Period (s) and Timeout Period (s).

    • Collection Period (s): O&M data collection period, in seconds. Options: 10s, 30s, and 60s (default).
    • Timeout Period (s): the maximum time allowed for executing a collection task, in seconds. Options: 10s, 30s, and 60s (default).
      NOTE:

      The timeout period cannot exceed the collection period.

    • Executor: user who executes the collection task, that is, the user of the selected host. Default: root. Enter a username. Recommended: root.

  4. Click Create.
  5. On the displayed collection task page, click the target collection task to view its details.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback