Monitoring
Monitoring API
Available API Paths
- /api/monitoring/brokers
- /api/monitoring/brokers/{brokerId}
- /api/monitoring/clusters
- /api/monitoring/clusters/{clusterName}
Path: /api/monitoring/brokers
Methods
GET
Returns the monitoring overview of all the brokers
Responses
Status | Description | Response Content or Scheme |
200 | Contains the overview information of all brokers. Each broker provides additional metrics information like the number of clients connected, the number of subscriptions and the number of messages received and sent |
|
Example
{
"total": 2,
"brokers": [
{
"id": "mosquitto1",
"name": "Mosquitto 1 Test Instance",
"status": {
"timestamp": 1234567,
"connected": false,
"error": {
"errno": -61,
"code": "ECONNREFUSED",
"syscall": "connect",
"address": "127.0.0.1",
"port": 1891
}
}
},
{
"id": "mosquitto2",
"name": "Mosquitto 2 Test Instance",
"status": {
"timestamp": 1234567,
"connected": true
},
"metrics": {
"version": "mosquitto version 2.1.0",
"clients": {
"total": "3",
"active": "1",
"connected": "1"
},
"load": {
"publish": {
"sent": {
"1min": "89.24",
"5min": "37.59",
"15min": "26.32"
}
},
"sockets": {
"15min": "0.87",
"1min": "1.96",
"5min": "0.74"
},
"connections": {
"15min": "0.87",
"1min": "1.96",
"5min": "0.74"
},
"messages": {
"received": {
"1min": "13.69",
"5min": "5.34",
"15min": "3.45"
},
"sent": {
"1min": "106.56",
"5min": "45.82",
"15min": "33.12"
}
},
"bytes": {
"received": {
"1min": "406.86",
"5min": "154.90",
"15min": "124.23"
},
"sent": {
"1min": "3418.76",
"5min": "1371.17",
"15min": "885.65"
}
}
},
"messages": {
"stored": "37",
"received": "195425",
"sent": "1207818"
},
"store": {
"messages": {
"count": "37",
"bytes": "200"
}
},
"subscriptions": {
"count": "7"
},
"retained messages": {
"count": "37"
},
"publish": {
"messages": {
"sent": "1012830"
},
"bytes": {
"sent": "5919457"
}
},
"bytes": {
"received": "17444986",
"sent": "43697617"
},
"uptime": "5367950 seconds"
}
}
]
}
Status | Description | Response Content or Scheme |
401 | Access to resource is denied. User not authenticated (logged in) or session expired |
|
403 | User does not have enough permissions to access the resource |
|
404 | Plugin is not enabled or not found |
|
410 | Requested entity does not exists or was removed |
|
500 | An internal server error has occured |
|
Path: /api/monitoring/brokers/{brokerId}
Methods
GET
Returns the monitoring overview of a signle broker
Parameters
Name | Location | Type | Required | Description |
---|---|---|---|---|
brokerId | path | string | true | Id of the broker which the information is requestsed for |
Responses
Status | Description | Response Content or Scheme |
200 | Contains detailed monitoring information on one single broker |
|
Example
{
"id": "mosquitto2",
"name": "Mosquitto 2 Test Instance",
"status": {
"timestamp": 1234567,
"connected": true
},
"metrics": {
"version": "mosquitto version 2.1.0",
"clients": {
"total": "3",
"active": "1",
"connected": "1"
},
"load": {
"publish": {
"sent": {
"1min": "89.24",
"5min": "37.59",
"15min": "26.32"
}
},
"sockets": {
"15min": "0.87",
"1min": "1.96",
"5min": "0.74"
},
"connections": {
"15min": "0.87",
"1min": "1.96",
"5min": "0.74"
},
"messages": {
"received": {
"1min": "13.69",
"5min": "5.34",
"15min": "3.45"
},
"sent": {
"1min": "106.56",
"5min": "45.82",
"15min": "33.12"
}
},
"bytes": {
"received": {
"1min": "406.86",
"5min": "154.90",
"15min": "124.23"
},
"sent": {
"1min": "3418.76",
"5min": "1371.17",
"15min": "885.65"
}
}
},
"messages": {
"stored": "37",
"received": "195425",
"sent": "1207818"
},
"store": {
"messages": {
"count": "37",
"bytes": "200"
}
},
"subscriptions": {
"count": "7"
},
"retained messages": {
"count": "37"
},
"publish": {
"messages": {
"sent": "1012830"
},
"bytes": {
"sent": "5919457"
}
},
"bytes": {
"received": "17444986",
"sent": "43697617"
},
"uptime": "5367950 seconds"
}
}
Status | Description | Response Content or Scheme |
401 | Access to resource is denied. User not authenticated (logged in) or session expired |
|
403 | User does not have enough permissions to access the resource |
|
404 | Plugin is not enabled or not found |
|
410 | Requested entity does not exists or was removed |
|
500 | An internal server error has occured |
|
Path: /api/monitoring/clusters
Methods
GET
Returns statuses of all the clusters
Responses
Status | Description | Response Content or Scheme |
200 | Contains a list of all available clusters plus an additional counter. Each cluster information contains the name, the description and a status of the cluster |
|
Example
{
"total": 3,
"clusters": [
{
"name": "mosquittotests1",
"description": "Mosquitto Test Cluster 1",
"status": {
"clusterstate": "active"
}
},
{
"name": "mosquittotests2",
"description": "Mosquitto Test Cluster 2",
"status": {
"clusterstate": "degraded"
}
},
{
"name": "mosquittotests3",
"description": "Mosquitto Test Cluster 3",
"status": {
"clusterstate": "inactive"
}
}
]
}
Status | Description | Response Content or Scheme |
401 | Access to resource is denied. User not authenticated (logged in) or session expired |
|
403 | User does not have enough permissions to access the resource |
|
404 | Plugin is not enabled or not found |
|
410 | Requested entity does not exists or was removed |
|
500 | An internal server error has occured |
|
Path: /api/monitoring/clusters/{clusterName}
Methods
GET
Returns status of a single cluster
Parameters
Name | Location | Type | Required | Description |
---|---|---|---|---|
clusterName | path | string | true | Name of the cluster which the information is requestsed for |
Responses
Status | Description | Response Content or Scheme |
200 | Contains the detailed information of one single cluster. For every cluster the same information is included as in the "Clusters" endpoint plus additional detail information, i.e., specific information about each node in the cluster |
|
Example
{
"name": "mosquittotests1",
"description": "Mosquitto Test Cluster 1",
"status": {
"clusterstate": "active"
},
"details": {
"nodes": [
{
"address": "172.20.1.1",
"port": 7000,
"nodeid": 1,
"broker": "mosquitto1",
"leader": true
},
{
"address": "172.20.1.2",
"port": 7000,
"nodeid": 2,
"broker": "mosquitto2",
"leader": false
},
{
"address": "172.20.1.3",
"port": 7000,
"nodeid": 2,
"broker": "mosquitto3",
"leader": false
}
]
}
}
Status | Description | Response Content or Scheme |
401 | Access to resource is denied. User not authenticated (logged in) or session expired |
|
403 | User does not have enough permissions to access the resource |
|
404 | Plugin is not enabled or not found |
|
410 | Requested entity does not exists or was removed |
|
500 | An internal server error has occured |
|