Show MQTT client monitoring statistics by REST Monitoring APIs
Purpose
Reports MQTT client monitoring data.URI
Use the Eclipse Amlen REST API GET method with the following Eclipse Amlen monitoring URI:
http://<admin-endpoint-IP:Port>/ima/v1/monitor/MQTTClient
Object configuration data
Provide query parameters requesting the statistics that you want returned in the JSON payload. The following example uses cURL to create MQTT client-related statistics:
curl -X GET http://127.0.0.1:9089/ima/v1/monitor/MQTTClient?ClientID=ClientID%26StatType=StatType
%26ResultCount=ResultCount
- ClientID
- Specifies the name of an MQTT client to collect data about.
- ResultCount
- Specifies the maximum number of results to return
- StatType
- Specifies the type of data to order the results by.
Usage NotesĀ®
- The command must be capitalized as shown.
- The command must use the double quotation marks as shown.
- The statistics that are produced can be up to 60 seconds out of date.
- The MQTT client must have a durable subscription, and must be disconnected, for monitoring data about that client to be returned.
- The following fields are returned:
-
- ClientId
- String
-
- IsConnected
- Boolean
-
- LastConnectedTime
- Boolean
-
Example
The following example uses cURL to show how a GET method is used to create statistics about a disconnected MQTT Client with a Client ID that is set to DemoClientID:
curl -X GET http://127.0.0.1:9089/ima/v1/monitor/MQTTClient?ClientID=DemoClientID
The following example shows a successful example response to the GET method that was used to create statistics about a disconnected MQTT Client with a Client ID that is set to DemoClientID:
{ "Version":"v1", "MQTTClient": [ { "ClientID":"DemoClientID","IsConnected":False,"LastConnectedTime":1446728129213566618 } ] }