节点

GET /api/v4/nodes/{node}

返回节点的状态。

Path Parameters:

NameTypeRequiredDescription
nodeStringFalse节点名字,如 “emqx@127.0.0.1。
不指定时返回所有节点的信息

Success Response Body (JSON):

NameTypeDescription
codeInteger0
dataObject/Array of Objectsnode 参数存在时返回指定节点信息,
不存在时以 Array 形式返回所有节点的信息
data.connectionsInteger当前接入此节点的客户端数量
data.load1String1 分钟内的 CPU 平均负载
data.load5String5 分钟内的 CPU 平均负载
data.load15String15 分钟内的 CPU 平均负载
data.max_fdsInteger操作系统的最大文件描述符限制
data.memory_totalStringVM 已分配的系统内存
data.memory_usedStringVM 已占用的内存大小
data.nodeString节点名称
data.node_statusString节点状态
data.otp_releaseStringEMQ X 使用的 Erlang/OTP 版本
data.process_availableInteger可用的进程数量
data.process_usedInteger已占用的进程数量
data.uptimeStringEMQ X 运行时间
data.versionStringEMQ X 版本

Examples:

获取所有节点的状态:

  1. $ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/nodes"
  2. {"data":[{"version":"develop","uptime":"7 seconds","process_used":315,"process_available":2097152,"otp_release":"R21/10.3.5","node_status":"Running","node":"emqx@127.0.0.1","memory_used":"96.75M","memory_total":"118.27M","max_fds":10240,"load5":"2.60","load15":"2.65","load1":"2.31","connections":0}],"code":0}

获取指定节点的状态:

  1. $ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/nodes/emqx@127.0.0.1"
  2. {"data":{"version":"develop","uptime":"2 minutes, 21 seconds","process_used":310,"process_available":2097152,"otp_release":"R21/10.3.5","node_status":"Running","node":"emqx@127.0.0.1","memory_used":101379168,"memory_total":123342848,"max_fds":10240,"load5":"2.50","load15":"2.61","load1":"1.99","connections":0},"code":0}