删除监控配置 本节主要介绍如何使用API删除监控配置。 此操作用来删除监控配置。 注意 如果删除了“指标必须具备的label”,可能会造成相关监控数据无法识别的风险。 请求语法 删除指定服务器的监控配置 plaintext DELETE /rest/v1/system/config/monitor?serverIdserverid1,serverid2,serveridN HTTP/1.1 Date: date ContentType: application/json; charsetutf8 ContentLength: length Host: ip:port Authorization: authorization { "pushgateway":address:port, "pushgatewayLabels": [ "key1", "key2", "key3", ... ] "collectMetric": name, "collectMetricItems": [ item1, item2, item3, ... itemN ] } 删除全局的监控配置 plaintext DELETE /rest/v1/system/config/monitor HTTP/1.1 Date: date ContentType: application/json; charsetutf8 ContentLength: length Host: ip:port Authorization: authorization { "metricDataformat": metricDataformat, "receiverUrl": receiverUrl, "collectMetric": name, "collectMetricItems": [ "item1", "item2", "item3", ... ], } 请求参数 参数 类型 描述 是否必须 serverId String 指定要删除监控配置的HBlock服务器ID。一次可以指定多个HBlock服务器的ID,以英文逗号(,)分开。如果不填写,默认为所有HBlock服务器删除指定的监控配置。 否 pushgateway String 指定Pushgateway的地址和接口。 取值:格式为IPv4 :port 、[IPv6 ]:port 或者domainname :port。 是 pushgatewayLabels Array of string 指定Pushgateway对应的标签值。 取值:label项。 说明 指定pushgateway时,此项才有效。指定pushgateway,但不指定pushgatewayLabels,表示删除整个pushgateway。 否 collectMetric String 指定采集的监控指标。 取值为:server、fileSystem、interface、load、disk、tcp、os。 默认删除的上述所有监控指标。 否 collectMetricItems Array of string 指定监控指标下的配置项。 说明 指定collectMetric时,此项才有效。指定collectMetric,但不指定collectMetricItems,表示删除采集的监控指标下的所有配置项。 否 metricDataformat String 指定metric的数据格式。 取值: pushgateway:删除Pushgateway监控配置。 prometheusTextBased:删除Prometheus文本格式的监控配置。 默认值为pushgateway。 否 receiverUrl String 指定删除监控数据推送的地址,格式为: 说明 仅metricDataformat取值为prometheusTextBased有效。 否