刪除pushgateway監控配置
更新時間 2025-04-23 15:02:34
最近更新時間: 2025-04-23 15:02:34
分享文章
本節主要介紹如何使用API刪除pushgateway監控配置。
此操作用來刪除pushgateway監控配置。
注意
如果刪除了“指標必須具備的label”,可能會造成相關監控數據無法識別的風險。
請求語法
DELETE /rest/v1/system/config/monitor?serverId=serverid1,serverid2,serveridN HTTP/1.1
Date: date
Content-Type: application/json; charset=utf-8
Content-Length: length
Host: ip:port
Authorization: authorization
{
"pushgateway":address:port,
"pushgatewayLabels": [
"key1",
"key2",
"key3",
...
]
"collectMetric": name,
"collectMetricItems": [
"item1",
"item2",
"item3",
...
],
}請求參數
| 參數 | 類型 | 描述 | 是否必須 |
|---|---|---|---|
| serverId | String | 指定要刪除pushgateway監控配置的HBlock服務器ID。一次可以指定多個HBlock服務器的ID,以英文逗號(,)分開。如果不填寫,默認為所有HBlock服務器刪除指定的pushgateway監控配置。 | 否 |
| pushgateway | String | 指定pushgateway的地址和接口。 取值:格式為IPv4:port、[IPv6]:port或者domain-name:port。 | 是 |
| pushgatewayLabels | Array of pushgatewayLabel | 指定pushgateway對應的標簽值。 取值:label項。 | 否 |
| collectMetric | String | 指定采集的監控指標。 取值為:server、fileSystem、interface、load、disk、tcp、os。 默認刪除的上述所有監控指標。 | 否 |
| collectMetricItems | Array of collectMetricItem | 指定監控指標下的配置項。 | 否 |
請求示例1
為服務器hblock_1、hblock_2刪除相關的pushgateway監控配置:標簽為agent、idc,監控指標為disk,監控指標配置項為pstore、devpts。
DELETE /rest/v1/system/config/monitor?serverId=hblock_1,hblock_2 HTTP/1.1
Date: Fri, Fri, 24 May 2024 07:01:39 GMT
Content-Type: application/json; charset=utf-8
Authorization: HBlock userName:signature
Content-Length: 216
Host: 192.168.0.110:1443
{
"pushgateway": "192.168.0.1:9091",
"pushgatewayLabels": [
"agent",
"idc"
],
"collectMetric": "disk",
"collectMetricItems": [
"pstore",
"devpts"
]
}響應示例1
HTTP/1.1 200 OK
x-hblock-request-id: 4b7487d492754feab5f572be3ae532f8
Connection: keep-alive
Date: Fri, 24 May 2024 07:01:39 GMT
Server: HBlock請求示例2
為所有服務器刪除相關的pushgateway監控配置:lable為agent、idc。
DELETE /rest/v1/system/config/monitor HTTP/1.1
Date: Fri, 24 May 2024 08:30:08 GMT
Content-Type: application/json; charset=utf-8
Authorization: HBlock userName:signature
Content-Length: 112
Host: 192.168.0.110:1443
{
"pushgateway": "192.168.0.1:9091",
"pushgatewayLabels": [
"agent",
"idc"
]
}響應示例2
HTTP/1.1 200 OK
x-hblock-request-id: ba61c4c8ecf54ad89ca872faa02c8433
Connection: keep-alive
Date: Fri, 24 May 2024 08:30:08 GMT
Server: HBlock