- 告警
- GET /api/v4/alarms
- GET /api/v4/nodes/{node}/alarms
- GET /api/v4/alarms/activated
- GET /api/v4/nodes/{node}/alarms/activated
- GET /api/v4/alarms/deactivated
- GET /api/v4/nodes/{node}/alarms/deactivated
- POST /api/v4/alarms/deactivated
- DELETE /api/v4/alarms/deactivated
- DELETE /api/v4/nodes/{node}/alarms/deactivated
告警
GET /api/v4/alarms
返回集群下当前告警信息。
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].name | String | 告警名称 |
data[0].alarms[0].message | String | 人类易读的告警信息 |
data[0].alarms[0].details | Object | 告警详情 |
data[0].alarms[0].activate_at | Integer | 告警激活时间,以微秒为单位的 UNIX 时间戳 |
data[0].alarms[0].deactivate_at | Integer | 告警取消激活时间,以微秒为单位的 UNIX 时间戳 |
data[0].alarms[0].activated | Boolean | 是否激活 |
Examples:
$ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/alarms"
{"data":[{"node":"emqx@127.0.0.1","alarms":[{"name":"high_system_memory_usage","message":"System memory usage is higher than 60%","details":{"high_watermark":60},"deactivate_at":"infinity","activated":true,"activate_at":1597996203658236},{"name":"high_system_memory_usage","message":"System memory usage is higher than 60%","details":{"high_watermark":60},"deactivate_at":1597994359335482,"activated":false,"activate_at":1597993108657522}]}],"code":0}
GET /api/v4/nodes/{node}/alarms
返回指定节点下的告警信息。接口参数和返回请参看 GET /api/v4/alarms。
Examples:
$ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/nodes/emqx@127.0.0.1/alarms"
{"data":[{"name":"high_system_memory_usage","message":"System memory usage is higher than 60%","details":{"high_watermark":60},"deactivate_at":"infinity","activated":true,"activate_at":1597996203658236},{"name":"high_system_memory_usage","message":"System memory usage is higher than 60%","details":{"high_watermark":60},"deactivate_at":1597994359335482,"activated":false,"activate_at":1597993108657522}],"code":0}
GET /api/v4/alarms/activated
返回集群下激活中的告警。接口参数和返回请参看 GET /api/v4/alarms。
Examples:
$ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/alarms/activated"
{"data":[{"node":"emqx@127.0.0.1","alarms":[{"name":"high_system_memory_usage","message":"System memory usage is higher than 60%","details":{"high_watermark":60},"deactivate_at":"infinity","activated":true,"activate_at":1597996203658236}]}],"code":0}
GET /api/v4/nodes/{node}/alarms/activated
返回指定节点下激活中的告警。接口参数和返回请参看 GET /api/v4/alarms。
Examples:
$ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/nodes/emqx@127.0.0.1/alarms/activated"
{"data":[{"name":"high_system_memory_usage","message":"System memory usage is higher than 60%","details":{"high_watermark":60},"deactivate_at":"infinity","activated":true,"activate_at":1597996203658236}],"code":0}
GET /api/v4/alarms/deactivated
返回集群下已经取消的告警。接口参数和返回请参看 GET /api/v4/alarms/activated。
Examples:
$ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/alarms/deactivated"
{"data":[{"node":"emqx@127.0.0.1","alarms":[{"name":"high_system_memory_usage","message":"System memory usage is higher than 60%","details":{"high_watermark":60},"deactivate_at":1597994359335482,"activated":false,"activate_at":1597993108657522}]}],"code":0}
GET /api/v4/nodes/{node}/alarms/deactivated
返回指定节点下已经取消的告警。接口参数和返回请参看 GET /api/v4/alarms/activated。
Examples:
$ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/nodes/emqx@127.0.0.1/alarms/deactivated"
{"data":[{"name":"high_system_memory_usage","message":"System memory usage is higher than 60%","details":{"high_watermark":60},"deactivate_at":1597994359335482,"activated":false,"activate_at":1597993108657522}],"code":0}
POST /api/v4/alarms/deactivated
取消指定告警。
Parameters (json):
Name | Type | Required | Default | Description |
---|---|---|---|---|
node | String | Required | 告警所在节点 | |
name | String | Required | 告警名称 |
Success Response Body (JSON):
Name | Type | Description |
---|---|---|
code | Integer | 0 |
Examples:
$ curl -i --basic -u admin:public -vX POST "http://localhost:8081/api/v4/alarms/deactivated" -d '{"node":"emqx@127.0.0.1","name":"high_system_memory_usage"}'
{"code":0}
DELETE /api/v4/alarms/deactivated
清除所有已经取消的告警。
Parameters (json): 无
Success Response Body (JSON):
Name | Type | Description |
---|---|---|
code | Integer | 0 |
Examples:
$ curl -i --basic -u admin:public -X DELETE "http://localhost:8081/api/v4/alarms/deactivated"
{"code":0}
DELETE /api/v4/nodes/{node}/alarms/deactivated
清除指定节点下所有已经取消的告警。
Parameters (json): 无
Success Response Body (JSON):
Name | Type | Description |
---|---|---|
code | Integer | 0 |
Examples:
$ curl -i --basic -u admin:public -X DELETE "http://localhost:8081/api/v4/nodes/emqx@127.0.0.1/alarms/deactivated"
{"code":0}