Viewing endpoint level statistics by using an external application

External monitoring applications can access endpoint data that is published by Eclipse Amlen by subscribing to the Eclipse Amlen topic $SYS/ResourceStatistics/Endpoint.

To publish monitoring data on a topic, the Eclipse Amlen server must be running.

The published data is in JSON format. The published data always includes Version, NodeName, Timestamp, and ObjectType. NodeName is the name of the server and ObjectType is the name of the object that you are monitoring.

For more information about monitoring by using an external application, see Monitoring and reporting.

Monitoring data is automatically published every 2 seconds to the topic string $SYS/ResourceStatistics/Endpoint. The name of the monitored endpoint is included in the message. If there are multiple instances of an endpoint, then the statistics of each instance are published in a separate message.

In MQTT, you cannot subscribe to a $SYS topic if you specify cleanSession=0. In JMS, you cannot subscribe to a $SYS topic if you use a durable subscription.

  1. Create an endpoint. You can use this endpoint to connect your external monitoring application to Eclipse Amlen and create a monitoring subscription. For more information about configuring an endpoint, see Configuring message hubs.
  2. Strengthen your security by configuring this endpoint specifically for monitoring, with connection and messaging policies to restrict access to monitoring data that is published on the topic root $SYS.
    For more information about configuring connection and messaging policies, see Configuring message hubs.
  3. Connect your external application to the endpoint that you created in step 1, and subscribe to the topic string $SYS/ResourceStatistics/Endpoint.

The following information is made available to the monitoring application:

  • Version
    String
    Specifies the version of server.
  • NodeName
    String
    Specifies the name of the server.
  • Timestamp
    Date/Time
    Specifies the date and time in ISO8601 format.
  • Object type
    String
    Specifies the type of object that you are monitoring.
  • Name
    String
    Specifies the name of the endpoint that you are monitoring.
  • Interface
    String
    Specifies the name of the ethernet interface that is associated with the endpoint.
  • Enabled
    Boolean
    Specifies whether the endpoint is enabled. If the endpoint is enabled and the LastErrorCode is 0, this indicates that the endpoint is accepting connections.
  • TotalConnections
    Numeric
    Specifies the total number of connections.
  • ActiveConnections
    Numeric
    Specifies the number of currently active connections.
  • BadConnections
    Numeric
    Specifies the number of connections that failed to connect since reset.
  • MsgRead
    Numeric
    Specifies the number of messages that are read since reset.
  • MsgWrite
    Numeric
    Specifies the number of messages that are written since reset.
  • BytesRead
    Numeric
    Specifies the number of bytes read since reset.
  • BytesWrite
    Numeric
    Specifies the number of bytes written since reset.
  • LostMessageCount
    Numeric
    Count of messages since reset that, when published, resulted in an error. This error can be caused by a number of events. It is usually caused when a message is published that cannot be accepted by one or more subscriptions and, because of the quality of service (QoS) of the message and subscriptions, the publish request fails. The publishing application receives an error.
  • ResetTime
    Date/Time
    Specifies the time at which the statistics for the endpoint were reset.
  • WarnMsgs
    Numeric
    Count of messages since reset that, when published, resulted in a warning. This count is increased when a message is published that cannot be accepted by one or more subscriptions but, because of the QoS of the message and subscriptions, the publish request does not fail. Even though the publish request does not fail, this count indicates that one or more subscriptions are not able to process the messages that are being published.

The following example shows a monitoring message that contains monitoring data about an endpoint.

{ 
	"Version":"1.2",
	"NodeName":"mar#678",
	"TimeStamp":"2014-07-26T12:52:41.226Z",
	"ObjectType":"Endpoint",  
	"Name":"DemoEndpoint", 
	"Interface":192.0.2.0, 
	"Enabled":1, 
	"Total":100, 
	"Active":73, 
	"BadConnections":0, 
	"MsgRead":5000, 
	"MsgWrite":5000, 
	"BytesRead":10000, 
	"BytesWrite":10000,
	"LostMessageCount":0,
	"ResetTime ":"2014-07-13T12:11:42Z",
	"WarnMsgs":0 
}