告警

GET /api/v4/alarms/present

返回集群下当前告警信息。

Path Parameters:

Success Response Body (JSON):

NameTypeDescription
codeInteger0
dataArray of Objects各节点上的告警列表
data[0].nodeString节点名称
data[0].alarmsArray of Objects当前告警列表
data[0].alarms[0].idString告警标识符
data[0].alarms[0].descString告警的详细描述

Examples:

  1. $ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/alarms/present"
  2. {"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:

  1. $ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/alarms/present/emqx@127.0.0.1"
  2. {"data":[{"id":"cpu_high_watermark","desc":"91.68333333333332"}],"code":0}

GET /api/v4/alarms/history

返回集群下历史告警信息。

Path Parameters:

Success Response Body (JSON):

NameTypeDescription
codeInteger0
dataArray of Objects各节点上的告警列表
data[0].nodeString节点名称
data[0].alarmsArray of Objects当前告警列表
data[0].alarms[0].idString告警标识符
data[0].alarms[0].descString告警的详细描述
data[0].alarms[0].clear_atString告警清除时间,格式为 “YYYY-MM-DD HH:mm:ss”

Examples:

  1. $ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/alarms/history"
  2. {"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:

  1. $ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/alarms/history/emqx@127.0.0.1"
  2. {"data":[{"id":"cpu_high_watermark","desc":"93.27055293970582","clear_at":"2020-02-21 13:50:10"}],"code":0}