百度智能云

All Product Document

          Cloud Monitor

          Use Method

          Certificate Configuration

          Before using the BCM-Tool to push the monitoring data, the user should first create a certificate file (the BCM-Tool installation directory contains a certificate file template, the user may make alterations based on the template). The certificate file can be stored in any directory without limitation. The following is an example of the format of the certificate file.

          [USER] 
          BCM_USER_ID = xxxxxxxxcfe04e2494c23974xxxxxxxx 
          [AKSK] 
          BCM_ACCESS_KEY = xxxxxxxx846d4884b9dfaed6xxxxxxxx 
          BCM_SECRET_KEY = xxxxxxxxfd764b2996412a66xxxxxxxx 

          The user only needs to fill in his/her own userId, accessKey and secretKey in the corresponding position of the certificate file, as shown the above "xxxxxxxxcfe04e2494c23974xxxxxxxx" (the value is only an example and not the actual information). Then just designate the certificate when using the tool.

          Set Environment Variables

          The BCM-Tool provides two parameters of -c/--credential-file and -u/--url to respectively designate the certificate file path and URL of the BCM server side. E.g.:

          bcm-tool metric-data-put --credential-file ./bcm-credential.template --url http://bcm.bj.baidubce.com  

          However, because the values of the two parameters are not changed frequently during the use process. The BCM-Tool supports the acquisition of the certificate path and URL of BCM services from the environment variables in order to avoid the designation for the command execution each time.

          The method of configuring environment variables is as follows:

          export BCM_CREDENTIAL_FILE=<credential_path> 
          export BCM_URL=http://bcm.bj.baidubce.com   or   export BCM_URL=http://bcm.gz.baidubce.com 

          Among them, the <credential_path> is the absolute path of the certificate, the bcm.bj.baidubce.com is the address of the BCM service (Beijing region), and the bcm.gz.baidubce.com is the address of the BCM service (Guangzhou region). The selection of regions will be introduced below.

          Note:

          When the user sets the environment variables and meanwhile designates the --credential-file and --url parameters, and the designated contents of the parameters are used first.

          Region Selection

          The BCM-Tool supports the pushing of user-defined monitoring data to different Regions, and users can designate one specific Region for pushing by configuring the URL.

          Region (Beijing) URL: bcm.bj.baidubce.com 
          Region (Guangzhou) URL: bcm.gz.baidubce.com 

          Introduction to BCM-Tool Command

          The BCM-Tool uses the subcommand mode to provide users with a series of monitoring and alarm functions. The users can use the following methods to view the subcommands supported by the BCM-Tool:

          bcm-tool help 

          The BCM-Tool currently supports three subcommands: The metric-data-put, metric-data-list and metric-meta-list are respectively the pushed monitoring data, queried monitoring data and queried monitoring meta-data.

          The user can also view the introduction to specific parameters and Examples of all subcommands, and the commands are as follows (taking the pushed monitoring data for example):

          bcm-tool help metric-data-put or bcm-tool metric-data-put --help.

          Push Monitoring Data

          Pushed data subcommand: Metric-data-put

          • Source data push.

            bcm-tool metric-data-put --scope <SCOPE> --metric-name <METRICNAME> --value <VALUE> --timestamp <TIMESTAMP>

            • --scope(-S) designates the service name space to be pushed.
            • --metric-name(-m) designates the monitoring items to be pushed.
            • --value(-v) designates the monitoring values to be pushed.
            • --timestamp(-t) designates the time stamp of monitoring information.
          • Push of aggregated data.

            bcm-tool metric-data-put --scope <SCOPE> --metric-name <METRICNAME> --statistic-value average=<VALUE>,sum=<VALUE>,maximum=<VALUE>,minimum=<VALUE> --timestamp <TIMESTAMP>

            • --statistic is used to designate aggregated monitoring values.

            Note: Only one of the two parameters of --value and -statistic can be designated for each data push.

          • Designate the dimension information of monitoring items.

            bcm-tool metric-data-put --scope <SCOPE> --metric-name <METRICNAME> --value <VALUE> --timestamp <TIMESTAMP> --dimensions <NAME>=<VALUE>,<NAME>=<VALUE>

            • --dimensions(-d) is used to designate the information dimension of the monitoring item.
          • Push the monitoring data by a file (users can generate monitoring data files by the correct json format).

            bcm-tool metric-data-put --scope <SCOPE> --data-file ./data.template

            • --data-file(-f) is used to designate a file.

          Moreover, users can also use the BCM-Tool to generate a monitoring data file template, and only need to modify the values in the file, which greatly facilitates users' use.

          • Generate a monitoring data file template.

            bcm-tool metric-data-put -T

          Query Monitoring Data

          Query the monitoring data subcommands: metric-data-list

          E.g.: bcm-tool metric-data-list --scope <SCOPE> --metric-name <METRICNAME> --statistics sum,average --start-time <STARTTIME> --end-time <ENDTIME> --period <PERIOD>

          *--scope: Designate the service name space of the query. 
          *--metric-name: Designate the monitoring item name to be queried. 
          *--statistics designates the method of aggregating the query to the original data. 
          *--start-time and --end-time designate the time interval for the query. 
          *--period is used to designate the aggregation period in seconds (the default value is 60). 

          In the query of monitoring data, the dimension information can be also designated by the --dimensions(-d) parameter.

          Query Monitoring Meta-data

          Query the subcommands of monitoring meta-data: metric-meta-list

          E.g.: bcm-tool metric-meta-list -S <SCOPE>

          Designate SCOPE as the monitoring meta-data for query of the current SCOPE. Execute the command, and the BCM service returns all monitoring item information to SCOPE, and includes the dimension information.

          If users want to view the meta-data of one monitoring item, as well as that of one specific dimension, the commands are as follows:

          bcm-tool metric-meta-list --scope <SCOPE> --metric-name <METRICNAME> 
          
          bcm-tool metric-meta-list --scope <SCOPE> --metric-name <METRICNAME> --dimensions <NAME>=<VALUE>,<NAME>=<VALUE>
          Previous
          Install Method
          Next
          Unload Method