All Products
Search
Document Center

CloudMonitor:Manage metric import tasks for self-managed data centers

Last Updated:Dec 11, 2023

You can create metric import tasks for self-managed data centers to import metric data to CloudMonitor. After the metric data is imported to CloudMonitor, you can create a dashboard to view the monitoring chart of a specified metric.

Prerequisites

  • CloudMonitor is connected with your data center and CloudMonitor is connected with the hosts whose middleware that you want to monitor in the data center.

  • A namespace is created. For more information, see Create a namespace.

Create a metric import task

  1. Install the CloudMonitor agent on the host.

  2. Install an exporter for the middleware of the self-managed data center.

    The following example shows how to install an exporter on a Redis instance.

    Important You can install the CloudMonitor agent and exporters only by using an administrator account. For Linux operating systems, use the root user account. For Windows operating systems, use the Administrator account. If you use an administrator account, certain risks may occur. For example, system stability or data security issues may occur. Proceed with caution.
    • Windows

      1. Log on to the host where the middleware resides as the administrator.

      2. Visit the download URL of the exporter and download the redis_exporter_win_amd64 exporter installation package to a local path.

        Note

        If you want to install the exporter for a different middleware, replace redis with the name of the middleware in the download URL.

      3. Double-click redis_exporter_win_amd64 to install the exporter.

      4. View the installation result of the exporter.

        1. Open the command prompt window.

          Press Win+R. In the Run dialog box, enter cmd and click OK.

        2. Run the following command to view the exporter status:

          tasklist | findstr "redis"

          If the following information is displayed, the exporter is installed.

          redis_exporter_win_amd64.     4496 RDP-Tcp#37                 3      7,924 K
    • Linux

      Note

      In the following commands, you must replace redis with the name of the middleware.

      1. Log on to the host where the middleware resides as the root user.

      2. Run the following command to download the installation package of the exporter:

        wget https://cms-prometheus.oss-cn-hangzhou.aliyuncs.com//redis/redis_exporter_linux_amd64

      3. Run the following command to grant the execute permissions on the redis_exporter_linux_amd64 file:

        chmod +x redis_exporter_linux_amd64

      4. Run the following command to change the name of the redis_exporter_linux_amd64 file to redis_exporter:

        mv redis_exporter_linux_amd64 redis_exporter

      5. Run the following command to install the exporter and start the service:

        ./redis_exporter -redis.addr localhost:6379 -web.listen-address localhost:9121

      6. Run the following command to check whether the exporter is installed:

        ps -ef | grep "redis_exporter"

        If the following information is displayed, the exporter is installed.

        root      461050  460640  0 15:46 pts/0    00:00:00 ./redis_exporter -redis.addr localhost:6379 -web.listen-address localhost:9121
        root      461166  461128  0 15:47 pts/5    00:00:00 grep --color=auto redis_exporter
  3. Create a metric import task.

    1. Log on to the CloudMonitor console.
    2. In the left-side navigation pane, choose Hybrid Cloud Monitoring > Namespace.

    3. Find the namespace and click the icon for account quantity, cloud service quantity, metric quantity, or task quantity in the Metric Data column.

      Note

      Task quantity indicates the total number of tasks that are used to import metrics from self-managed data centers, AWS, Tencent Cloud, and Prometheus, on-premises log monitoring data, and Simple Log Service log monitoring data.

    4. In the Metric management panel, click the Data Center tab. On the Data Center tab, click Metric Data.

    5. In the Basic Task Information step of the Metric Data dialog box, configure the basic information of the metric import task and click Next.

      Parameter

      Description

      Select Middleware to Be Monitored

      The middleware of the host. Valid values: Spring, Tomcat, Nginx, Tengine, JVM, Redis, Mysql, and Others.

      Custom Middleware

      The name of the custom middleware.

      If you select Others from the Select Middleware to Be Monitored drop-down list, you must enter the name of the custom middleware.

      Task Name

      The name of the metric import task.

      Task Description

      The description of the metric import task.

      Select Host

      One or more hosts of the self-managed data center.

      Note

      You must make sure that the CloudMonitor agent is installed on all the selected hosts.

      Region

      The region where the host resides.

      Note

      You can click Advanced Options to configure this parameter.

      Network Type

      The network type of the host. Valid values:

      • VPC

      • classic

      Note

      You can click Advanced Options to configure this parameter.

    6. In the Data Access Check step, check whether the latest version of the CloudMonitor agent and the exporter are installed, and click Next.

    7. In the Task Details step, enter the URL of the collection target, select the interval and timeout period for data collection, set tags for the metric import task, and then click Next.

    8. In the Dashboard step, click Close.

Modify a metric import task

  1. Log on to the CloudMonitor console.
  2. In the left-side navigation pane, choose Hybrid Cloud Monitoring > Namespace.

  3. Find the namespace and click the icon for account quantity, cloud service quantity, metric quantity, or task quantity in the Metric Data column.

    Note

    Task quantity indicates the total number of tasks that are used to import metrics from self-managed data centers, AWS, Tencent Cloud, and Prometheus, on-premises log monitoring data, and Simple Log Service log monitoring data.

  4. In the Metric management panel, click the Data Center tab. On the Data Center tab, find the metric import task that you want to modify and click Modify in the Actions column.

  5. In the Basic Task Information step of the Metric Data dialog box, configure the basic information of the metric import task and click Next.

  6. In the Data Access Check step, check whether the latest version of the CloudMonitor agent and the exporter are installed, and click Next.

  7. In the Task Details step, enter the URL of the collection target, select the interval and timeout period for data collection, set tags for the metric import task, and then click Next.

  8. In the Dashboard step, click Close.

Delete a metric import task

  1. Log on to the CloudMonitor console.
  2. In the left-side navigation pane, choose Hybrid Cloud Monitoring > Namespace.

  3. Find the namespace and click the icon for account quantity, cloud service quantity, metric quantity, or task quantity in the Metric Data column.

    Note

    Task quantity indicates the total number of tasks that are used to import metrics from self-managed data centers, AWS, Tencent Cloud, and Prometheus, on-premises log monitoring data, and Simple Log Service log monitoring data.

  4. In the Metric management panel, click the Data Center tab. On the Data Center tab, find the metric import task that you want to delete and click Delete in the Actions column.

  5. In the Confirm deletion message, click Confirm.