查询监控配置 本节主要介绍如何使用API查询Pushgateway监控配置。 此操作用来查询Pushgateway监控配置信息。 请求语法 查询指定服务器的监控配置 plaintext GET /rest/v1/system/config/monitor?serverIdserverid1,serverid2,serveridN HTTP/1.1 HTTP/1.1 Date:date Host: ip:port Authorization:authorization 查询所有服务器的监控配置 plaintext GET /rest/v1/system/config/monitor HTTP/1.1 HTTP/1.1 Date:date Host: ip:port Authorization:authorization 请求参数 参数 类型 描述 是否必须 serverId String 指定查询Pushgateway监控配置的HBlock服务器ID。一次可以指定多个HBlock服务器的ID,以英文逗号(,)分开。如果不填写,默认查询所有HBlock服务器的Pushgateway监控配置。 否 响应结果 名称 类型 描述 monitors Array of monitor 监控信息,详见“表1 响应参数monitor说明”。 表1 响应参数monitor说明 名称 类型 描述 serverId String 服务器ID。 send Object of send 发送端监控配置,详见“表2 响应参数send说明”。 collect Object of collect 硬件采集信息,详见表“表7 响应参数collect说明”。 表2 响应参数send说明 名称 类型 描述 pushgatewayTimeout Long 向所有Pushgateway推送数据的超时时长,超时即认为推送失败。 pushgateways Array of pushgateway Pushgateway信息,详见“表3 响应参数Pushgateway说明”。 receiverTimeout Long 向所有receiver发送数据的超时时间。 receivers Array of receiver receiver信息,详见“表5 响应参数receiver说明”。 表3 响应参数Pushgateway说明 名称 类型 描述 address String Pushgateway的IP或域名。 port Integer Pushgateway的端口号。 labels Object of label Pushgateway标签信息,详见“表4 响应参数label说明”。 表4 响应参数label说明 名称 类型 描述 agent String Pushgateway的客户端。 idc Integer 数据所属的数据中心。 hostname String 主机名称。 serverIp String 服务器IP。 clusterId String 集群ID。 clusterName String 集群名称。 job String Pushgateway推送数据的来源。 表5 响应参数receiver说明 名称 类型 描述 receiverUrl String 监控数据推送地址URL。 method Integer 推送监控数据的请求方法。 authType String 认证鉴权类型。 basicUsername String 鉴权类型为Basic时,basic的用户名。 basicPassword String 鉴权类型为Basic时,basic的密码。 说明 仅当请求包含请求头xhttpclient: httpshell 时,响应才会返回此字段。 bearerToken String 鉴权类型为Bearer时,Bearer的token。 说明 仅当请求包含请求头xhttpclient: httpshell 时,响应才会返回此字段。 metricLabels Object of metricLabel 监控数据推送地址对应的标签值,详见“表6 响应参数metricLabel说明”。 表6 响应参数metricLabel说明 名称 类型 描述 agent String 监控数据推送的客户端。 idc Integer 数据所属的数据中心。 hostname String 主机名称。 serverIp String 服务器IP。 clusterId String 集群ID。 clusterName String 集群名称。 job String 推送数据的来源。 表7 响应参数collect说明 名称 类型 描述 interval Long 硬件指标采集的采集间隔。 metrics Array of metric 硬件采集指标信息,详见“表8 响应参数metric说明”。 表8 响应参数metric说明 名称 类型 描述 name String 采集间隔或采集对象的硬件指标类别名称。 interval Long 硬件指标类别单独设置的采集间隔。 items String 硬件指标类别单独设置的采集对象。