告警
GET /api/v4/alarms/present
返回集群下当前告警信息。
Path Parameters: 无
Success Response Body (JSON):
Name | Type | Description |
---|---|---|
code | Integer | 0 |
data | Array of Objects | 各节点上的告警列表 |
data[0].node | String | 节点名称 |
data[0].alarms | Array of Objects | 当前告警列表 |
data[0].alarms[0].id | String | 告警标识符 |
data[0].alarms[0].desc | String | 告警的详细描述 |
Examples:
$ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/alarms/present"
{"data":[{"node":"emqx@127.0.0.1","alarms":[{"id":"cpu_high_watermark","desc":"88.30833333333334"}]}],"code":0}
GET /api/v4/alarms/present/{node}
返回指定节点下当前告警信息。接口参数和返回请参看 GET /api/v4/stats。
Examples:
$ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/alarms/present/emqx@127.0.0.1"
{"data":[{"id":"cpu_high_watermark","desc":"91.68333333333332"}],"code":0}
GET /api/v4/alarms/history
返回集群下历史告警信息。
Path Parameters: 无
Success Response Body (JSON):
Name | Type | Description |
---|---|---|
code | Integer | 0 |
data | Array of Objects | 各节点上的告警列表 |
data[0].node | String | 节点名称 |
data[0].alarms | Array of Objects | 当前告警列表 |
data[0].alarms[0].id | String | 告警标识符 |
data[0].alarms[0].desc | String | 告警的详细描述 |
data[0].alarms[0].clear_at | String | 告警清除时间,格式为 “YYYY-MM-DD HH:mm:ss” |
Examples:
$ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/alarms/history"
{"data":[{"node":"emqx@127.0.0.1","alarms":[{"id":"cpu_high_watermark","desc":"93.27055293970582","clear_at":"2020-02-21 13:50:10"}]}],"code":0}
GET /api/v4/alarms/history/{node}
返回指定节点下历史告警信息。接口参数和返回请参看 GET /api/v4/alarms/history。
Examples:
$ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/alarms/history/emqx@127.0.0.1"
{"data":[{"id":"cpu_high_watermark","desc":"93.27055293970582","clear_at":"2020-02-21 13:50:10"}],"code":0}