此操作用来查询pushgateway监控配置信息。
请求语法
GET /rest/v1/system/config/monitor?serverId=serverid1,serverid2,serveridN HTTP/1.1
HTTP/1.1
Date:date
Host: ip:port
Authorization:authorizationq
请求参数
参数 | 描述 | 是否必须 |
---|---|---|
serverId | 指定查询pushgateway监控配置的HBlock服务器ID。一次可以指定多个HBlock服务器的ID,以英文逗号(,)分开。如果不填写,默认查询所有HBlock服务器的pushgateway监控配置。 类型:字符串 |
否 |
响应结果
名称 描述 serverId 服务器ID。 send.pushgatewayTimeout 向所有pushgateway推送数据的超时时长,超时即认为推送失败。 send.pushgateways.adress pushgateway的IP或域名。 send.pushgateways.labels pushgateway对应的标签。 collect.interval 硬件指标采集的采集间隔。 collect.metrics.name 采集间隔或采集对象的硬件指标类别名称。 collect.metrics.interval 硬件指标类别单独设置的采集间隔。 collect.metrics.items 硬件指标类别单独设置的采集对象。
请求示例1
查询服务器hblock_2、hblock_3的pushgateway监控配置。
GET /rest/v1/system/config/monitor?serverId=hblock_2,hblock_3 HTTP/1.1
Date: Fri, 24 May 2024 08:58:12 GMT
Content-Type: application/json; charset=utf-8
Authorization: HBlock userName:signature
Host: 192.168.0.110:1443
响应示例1
HTTP/1.1 200 OK
x-hblock-request-id: 4b5e0623e73a4dcd8754fd2ed504b9c1
Connection: keep-alive
Content-Length: 1115
Date: Fri, 24 May 2024 08:58:12 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"monitors": [
{
"serverId": "hblock_2",
"send": {
"interval": 20000,
"timeout": 2000,
"pushgatewayTimeout": 3000,
"pushgateways": [
{
"address": "192.168.0.1",
"port": 9091,
"labels": {
"agent": "ctyun",
"idc": "3",
"hostname": "pm-006",
"serverIp": "192.168.0.192",
"clusterId": "B8BFE310-8DF6-429E-8C8A-ACD22310AC08",
"clusterName": "stor2",
"job": "hblock"
}
}
]
},
"collect": {
"interval": 14000,
"metrics": [
{
"name": "storFs",
"interval": 20000,
"items": [
"ds-1",
"mdm"
]
},
{
"name": "server",
"interval": 5000,
"items": [
"cpu"
]
},
{
"name": "disk",
"interval": 5000,
"items": [
"tmpfs",
"devpts",
"pstore",
"cgroup"
]
}
]
}
},
{
"serverId": "hblock_3",
"send": {
"interval": 20000,
"timeout": 2000,
"pushgatewayTimeout": 3000,
"pushgateways": [
{
"address": "192.168.0.1",
"port": 9091,
"labels": {
"agent": "ctyun",
"idc": "3",
"hostname": "ecs-9689-0915140",
"serverIp": "192.168.0.102",
"clusterId": "B8BFE310-8DF6-429E-8C8A-ACD22310AC08",
"clusterName": "stor2",
"job": "hblock"
}
}
]
},
"collect": {
"interval": 14000,
"metrics": [
{
"name": "storFs",
"interval": 20000,
"items": [
"ds-1"
]
},
{
"name": "server",
"interval": 5000,
"items": [
"cpu"
]
},
{
"name": "disk",
"interval": 5000,
"items": [
"tmpfs",
"devpts",
"pstore",
"cgroup"
]
}
]
}
}
]
}
}
请求示例2
查询所有服务器的pushgateway监控配置。
GET /rest/v1/system/config/monitor HTTP/1.1
Date: Fri, 24 May 2024 09:06:56 GMT
Content-Type: application/json; charset=utf-8
Authorization: HBlock userName:signature
Host: 192.168.0.110:1443
响应示例2
HTTP/1.1 200 OK
x-hblock-request-id: 4b5e0623e73a4dcd8754fd2ed504b9c1
Connection: keep-alive
Content-Length: 1115
Date: Fri, 24 May 2024 09:06:56 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"monitors": [
{
"serverId": "hblock_1",
"send": {
"interval": 20000,
"timeout": 2000,
"pushgatewayTimeout": 3000,
"pushgateways": [
{
"address": "192.168.0.1",
"port": 9091,
"labels": {
"hostname": "hblockserver",
"serverIp": "192.168.0.110",
"clusterId": "B8BFE310-8DF6-429E-8C8A-ACD22310AC08",
"clusterName": "stor2",
"job": "hblock",
"agent": "ctyun",
"idc": "3"
}
}
]
},
"collect": {
"interval": 14000,
"metrics": [
{
"name": "storFs",
"interval": 20000,
"items": [
"ds-1",
"ds-2",
"mdm"
]
},
{
"name": "disk",
"interval": 5000,
"items": [
"tmpfs",
"devpts",
"pstore",
"cgroup"
]
}
]
}
},
{
"serverId": "hblock_3",
"send": {
"interval": 20000,
"timeout": 2000,
"pushgatewayTimeout": 3000,
"pushgateways": [
{
"address": "192.168.0.1",
"port": 9091,
"labels": {
"agent": "ctyun",
"idc": "3",
"hostname": "ecs-9689-0915140",
"serverIp": "192.168.0.102",
"clusterId": "B8BFE310-8DF6-429E-8C8A-ACD22310AC08",
"clusterName": "stor2",
"job": "hblock"
}
}
]
},
"collect": {
"interval": 14000,
"metrics": [
{
"name": "storFs",
"interval": 20000,
"items": [
"ds-1"
]
},
{
"name": "server",
"interval": 5000,
"items": [
"cpu"
]
},
{
"name": "disk",
"interval": 5000,
"items": [
"tmpfs",
"devpts",
"pstore",
"cgroup"
]
}
]
}
},
{
"serverId": "hblock_2",
"send": {
"interval": 20000,
"timeout": 2000,
"pushgatewayTimeout": 3000,
"pushgateways": [
{
"address": "192.168.0.1",
"port": 9091,
"labels": {
"agent": "ctyun",
"idc": "3",
"hostname": "pm-006",
"serverIp": "192.168.0.192",
"clusterId": "B8BFE310-8DF6-429E-8C8A-ACD22310AC08",
"clusterName": "stor2",
"job": "hblock"
}
}
]
},
"collect": {
"interval": 14000,
"metrics": [
{
"name": "storFs",
"interval": 20000,
"items": [
"ds-1",
"mdm"
]
},
{
"name": "server",
"interval": 5000,
"items": [
"cpu"
]
},
{
"name": "disk",
"interval": 5000,
"items": [
"tmpfs",
"devpts",
"pstore",
"cgroup"
]
}
]
}
}
]
}
}