Global diagnostic items
- Last UpdatedAug 21, 2024
- 4 minute read
Global diagnostic items provide diagnostic information related to the entire MQTT connection.
The syntax to access a global diagnostic item is:
/$SYS$DIAG/<Item Name>
For example, the syntax to access the IP address and port number details of the MQTT broker is:
/$SYS$DIAG/BrokerAddress
Refer to the following table for the entire of list of global diagnostic items available for the MQTT Communication Driver.
Global Diagnostic Items
|
<ItemName> |
DataType |
Read/ Write |
Subscriber/Publisher Availability |
Description |
|
BrokerAddress |
String |
R |
Both |
Displays the IP address and port number of the MQTT broker or host name that was configured while connecting to the broker. Example: 127.0.0.1:1883, |
|
ClientId |
String |
R |
Both |
Displays the unique identifier of the MQTT subscriber/publisher client connection to the broker. Each connection to the broker is assigned a unique ID during the broker or publisher configuration. |
|
PersistSession |
Bool |
R |
Both |
Displays 'True' or 'False' based on whether the Persist Session checkbox was enabled during the MQTT broker configuration. When enabled, the broker stores any QoS1 or QoS2 messages that have not been retrieved. |
|
PayloadType |
String |
R |
Both |
Displays the format of the message payload. For the subscriber, the value can be either JSON or JSON_Sparkplug. For the publisher, the value can be JSON-VTQ1, JSON-VTQ2, or Sparkplug. |
|
ServerCertificateExpiryDate |
VT_DATE (DateTime) |
R |
Both |
Displays the TLS Certificate expiry date of the MQTT broker. If TLS is not used, then value is initialized to 01/01/1970 00:00:00 AM and Quality = 0x20. |
|
ServerCertificateSubject |
String |
R |
Both |
Displays the TLS Certificate subject of the MQTT broker. If TLS is not used, then the value is initialized to an empty string. |
|
ClientCertificateExpiryDate |
VT_DATE (DateTime) |
R |
Both |
Displays TLS Certificate expiry date of the MQTT client. If TLS is not used, then value is initialized to 01/01/1970 00:00:00 AM and Quality = 0x20. |
|
ClientCertificateSubject |
String |
R |
Both |
Displays TLS Certificate subject of the MQTT client. If TLS is not used, then the value is initialized to empty string. |
|
IsAnonymous |
Bool |
R |
Both |
Displays 'True' if user credentials are not provided while configuring the broker. Empty if the user credentials are provided. |
|
UserName |
String |
R |
Both |
Displays the user credentials provided while configuring the broker. (Empty if IsAnonymous=True) |
|
StartDateTime |
VT_DATE (DateTime) |
R |
Both |
Displays the Date and Time when the MQTT Communication Driver was started. |
|
UpTime |
Int64 (DateTime) |
R |
Both |
Displays the elapsed time in seconds since the MQTT Communication Driver was started. |
|
ConnectionEvents |
Int32 |
R |
Both |
Displays the number of times the MQTT publisher/subscriber connects to the MQTT broker. |
|
LastConnectTime |
VT_DATE (DateTime) |
R |
Both |
Displays the time when the last connection of the MQTT subscriber/publisher to the broker was successful. |
|
LastDisconnectTime |
VT_DATE (DateTime) |
R |
Both |
Displays the time when the MQTT subscriber/publisher last disconnected from the broker. |
|
SubscribedItemCount |
Int32 |
R |
Subscriber only |
Displays the total number of subscribed items under the broker. |
|
PublishedItemCount |
Int32 |
R |
Publisher only |
Displays the total number of published items under the broker. |
|
LastPublishTime |
VT_DATE (DateTime) |
R |
Both |
Displays the time when the last message was published in the broker. Default value is 01/01/1970 00:00:00 AM and Quality = 0x20 |
|
TotalReadErrors |
Int32 |
R |
Subscriber only |
Displays the total number of failed read operations in all connections since the MQTT Communication Driver was started or last reseted. (An error is counted if one or more item reads failed, or the entire read is not executed). |
|
TotalWriteErrors |
Int32 |
R |
Both |
Displays the total number of failed write operations in all connections since the MQTT Communication Driver was started or last reseted. (An error is counted if one or more item writes failed, or the entire write is not executed) |
|
TotalPublishErrors |
Int32 |
R |
Publisher only |
Displays the total number of failed publish operations in all connections to the broker since the MQTT Communication Driver was started or last reseted. |
|
ResetTotals |
Bool |
RW |
Both |
Displays 'True' or 'False' based on whether there was a reset of the values of the
following system items: TotalReadItemErrors, TotalDataMessagesPublished, Default value: False |
|
LastPayloadSizeIncoming |
Int32 |
R |
Mainly for Subscriber |
Displays the length of incoming buffer in the response from the MQTT broker. |
|
LastPayloadSizeOutgoing |
Int32 |
R |
Both |
Displays the length of outgoing buffer in the request from the MQTT Communication Driver. |
|
CumulativeBytesReceived |
Int64 |
R |
Mainly for Subscriber |
Displays the cumulative count of total bytes received from MQTT broker since the driver was started or last reseted (aggregate of LastPayloadSizeIncoming). |
|
CumulativeBytesSent |
Int64 |
R |
Both |
Displays the cumulative count of total bytes sent to MQTT broker since the driver was started or last reseted (aggregate of LastPayloadSizeOutgoing). |
|
StoreAndForwardActive |
Bool |
R |
Publisher only |
Displays 'True' or 'False' based on whether the Enable Store and Forward checkbox was enabled during publisher configuration. If the value is 'True', there is an outage in the connection to the MQTT broker. Publishing data is being stored locally and will be sent once the connection is up. If this value is 'False', the MQTT Communication Driver is publishing data directly to the MQTT broker. |
|
TotalPublishingDevices |
Int32 |
R |
Publisher only |
Displays the total number of publishing devices connected to the broker. |
|
TotalDataMessagesPublished |
Int32 |
R |
Publisher only |
Displays the total umber of data messages published since MQTT Communication Driver the driver was started or last reseted. |
|
Run |
Bool |
RW |
Both |
Displays 'True' (non-zero) if the system items calculation and reporting is enabled.
True is the default value. |