This plugin provides information about clients connected to the broker.
The topic of the plugins control API is $CONTROL/cedalo/inspect/v1
.
Currently supported commands offered by the API are listClients
for an
overview which clients are connected and the getClient
command to get
detailed information about a specific client.
Accepts the following message:
Example of an listClients message.
{
"commands": [
{
"command": "listClients",
"verbose": true,
"count": 10,
"offset": 100,
"correlationData": "12345-list-req"
}
]
}
Example of an getClient message.
{
"commands": [
{
"command": "getClient",
"clientid": "monitoring-client",
"correlationData": "12345-get-req"
}
]
}
Accepts the following message:
successful getClient response message.
{
"responses": [
{
"command": "getClient",
"data": {
"clientid": "admin-connect",
"username": "admin",
"address": "127.0.0.1",
"protocol": "MQTT",
"protocolVersion": "v3.1.1",
"numSubscriptions": 1,
"numPublished": 2,
"numSubscribed": 1,
"numDropped": 0,
"bytesPublished": 50,
"bytesSubscribed": 125,
"connected": true,
"lastConnect": 1668005037000,
"lastDisconnect": null,
"keepalive": 60,
"cleanSession": false,
"tls": {
"clientCertificate": "<cert in PEM format>",
"version": "TLSv1.3",
"ciphers": "TLS_AES_256_GCM_SHA384"
},
"listener": {
"port": 8883,
"bind_address": "127.0.0.1"
},
"will": {
"topic": "last/will/topic",
"qos": 1,
"retain": true,
"payload": "<base64 encoded payload>",
"properties": [
{
"identifier": "user-property",
"name": "key",
"value": "value"
},
{
"identifier": "content-type",
"value": "application/test"
}
],
"delayInterval": 3
},
"subscriptions": [
"$SYS/#"
],
"queues": {
"bytesIn": 0,
"bytesOut": 0,
"bytesMax": 0,
"messagesIn": 0,
"messagesMax": 1000,
"messagesInQos12": 0,
"messagesOut": 0,
"messagesOutQos12": 0,
"pagedMessagesOut": 0,
"pagedMessagesMax": 20
},
"inflight": {
"bytesIn": 0,
"bytesOut": 0,
"bytesMax": 0,
"messagesIn": 0,
"messagesInMax": 20,
"messagesOut": 0,
"messagesOutMax": 20,
"messagesMax": 20
}
},
"correlationData": "37a6e977-2b4f-4431-83f7-5bd93b35c152"
}
]
}
successful listClients response message.
{
"responses": [
{
"command": "listClients",
"data": {
"clients": [
{
"clientid": "admin-connect",
"username": "admin",
"address": "127.0.0.1",
"protocol": "MQTT",
"protocolVersion": "v3.1.1",
"connected": true,
"lastConnect": 1668005037000,
"lastDisconnect": null,
"queues": {
"bytesOut": 0,
"bytesMax": 0,
"messagesOut": 0,
"messagesMax": 1000,
"pagedMessagesOut": 0,
"pagedMessagesMax": 1000
}
},
{
"clientid": "auto-97E83DDF-6255-D78B-C776-4E02664C3E4C",
"username": "demo",
"address": "127.0.0.1",
"protocol": "MQTT",
"protocolVersion": "v5",
"connected": false,
"lastConnect": 1668005032144,
"lastDisconnect": 1668005045311
}
],
"totalCount": 2
},
"correlationData": "37a6e977-2b4f-4431-83f7-5bd93b35c152"
}
]
}
{
"responses": [
{
"command": "listClients",
"correlationData": "37a6e977-2b4f-4431-83f7-5bd93b35c152",
"data": {
"clients": [
"admin-connect",
"auto-97E83DDF-6255-D78B-C776-4E02664C3E4C"
],
"totalCount": 2
}
}
]
}
Example of an error response message.
{
"responses": [
{
"command": "getClient",
"error": "Client not found",
"correlationData": "37a6e977-2b4f-4431-83f7-5bd93b35c152"
}
]
}
This is an optional value to be able to identify the relation between request and response. The plugin will add the provided value in the response message.