Viewing endpoint level statistics by using REST Monitoring APIs

System administrators can view monitoring statistics by using REST Monitoring APIs.

System administrators can view endpoint level statistics by using the Amlen WebUI, by using a REST Monitoring API, or by using an external monitoring application. For more information about using the Amlen WebUI to view endpoint level statistics, see Viewing endpoint level statistics by using the GUI. For more information about using an external application to view endpoint level statistics, see Viewing endpoint level statistics by using an external application.

Endpoint-related monitoring statistics can be viewed by using a REST Monitoring API. To create endpoint-related monitoring statistics, complete the following steps:
  1. Use the Eclipse Amlen REST API GET method with the following Eclipse Amlen monitoring URI:

    http://<admin-endpoint-IP:Port>/ima/v1/monitor/<Object Type>

  2. Provide query parameters requesting the statistics that you want returned in the JSON payload. The following example uses cURL to create endpoint-related statistics:
    curl -X GET http://127.0.0.1:9089/ima/v1/monitor/Endpoint?Name=EndpointName%26SubType=SubType%26Duration=Duration%26StatType=StatType
    

    where:

    • Name
      Specifies the name of the endpoint.
    • SubType
      Specifies the statistics to create
      This value can be one of the following values:
      Current®
      View the most recent statistics.
      History
      View older statistics.
    • Duration
      Specifies the time span (in seconds) of the data to be collected.

      Valid value range is 1 - 86400.

      The default value is 1800.

    • StatType
      Specifies the type of data to order the results by.
      This value can be one of the following values:
      ActiveConnections
      Currently active connections.
      Connections
      Count of connections since Eclipse Amlen was last reset.
      BadConnections
      Count of connections that failed to connect since reset.
      LostMsgs
      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.
      ReadMsgs
      Count of messages read since reset.
      ReadBytes
      Count of bytes read since reset.
      WarnMsgs
      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.

      WriteMsgs
      Count of messages written since reset.
      WriteBytes
      Count of bytes written since reset.
      The default value is ActiveConnections.
The following fields are returned:
  • Name
    String
    The name of the endpoint.
  • IPAddr
    String
    The network interface address to which the endpoint is bound.
  • Enabled
    Boolean
    Indicates whether the endpoint is enabled. If the endpoint is enabled and the LastErrorCode is 0, this indicates that the endpoint is accepting connections.
  • Total
    Numeric
    The number of connections that completed through to the protocol handshake since configuration time.
  • Active
    Numeric
    The number of connections that are currently active.
  • Messages
    Numeric
    The number of messages that are sent or received since configuration time.
  • Bytes
    Numeric
    The number of bytes that are sent and received since configuration time.
  • LastErrorCode
    Numeric
    This value provides an indication of the success of the last configuration of the endpoint. An endpoint is working if Enabled is 1 and LastErrorCode is 1. For more information about error codes, see Message catalog.
  • ConfigTime
    Numeric
    Specifies the number of microseconds since the unix epoch.
    The time of the last major configuration of an endpoint and when the statistics were reset. The ConfigTime is usually the time at which the endpoint is first enabled. If the endpoint is deleted and re-created, then the configuration time is updated. The ConfigTime is used by monitoring applications that keep time series statistics so that any discontinuity is identifiable.
  • BadConnections
    Numeric
    The count of connections that failed before the protocol handshake completed.

The following example uses cURL to show how a GET method is used to create the most recent statistics for all endpoints:

curl -X GET http://127.0.0.1:9089/ima/v1/monitor/Endpoint?SubType=Current  
 
 

The following example shows a successful example response to the GET method that was used to create the most recent statistics for all endpoints:

{ 
    "Version":"v1", 
      "Endpoint": [ 
        {
          "Name":"DemoEndpoint","IPAddr":"ALL","Enabled":false,"Total":0,"Active":0,
          "Messages":0,"Bytes":0,"LastErrorCode":0,
          "ConfigTime":"2015-12-11T18:29:15.519Z","ResetTime":null,"BadConnections":0
        },
        {
          "Name":"DemoMqttEndpoint","IPAddr":"ALL","Enabled":false,"Total":0,"Active":0,
          "Messages":0,"Bytes":0,"LastErrorCode":0,
          "ConfigTime":"2015-12-11T18:29:15.519Z","ResetTime":null,"BadConnections":0
        },
        {
          "Name":"!MQConnectivityEndpoint","IPAddr":"/var/messagesight/data/MQConnectivityEndpoint_34109b4a50a7",
          "Enabled":true, "Total":0,"Active":0,"Messages":0,"Bytes":0,"LastErrorCode":0,
          "ConfigTime":"2016-04-27T16:42:33.464-05:00","ResetTime":null,"BadConnections":0
        } 
      ]  }
Note: In the example that shows the most recent statistics for all endpoints, !MQConnectivityEndpoint is displayed even if MQConnectivity is not enabled. !MQConnectivityEndpoint is an internal pre-configured endpoint that cannot be changed.

The following example uses cURL to show how a GET method is used to create the most recent statistics about an endpoint called DemoEndpoint:

curl -X GET http://127.0.0.1:9089/ima/v1/monitor/Endpoint?Name=DemoEndpoint%26SubType=Current  
 
 

The following example shows a successful example response to the GET method that was used to create the most recent statistics about an endpoint called DemoEndpoint:

{ "Version":"v1", "Endpoint": [ {
    "Name":"DemoEndpoint","IPAddr":"ALL","Enabled":false,"Total":0,"Active":0,"Messages":0,"Bytes":0,"LastErrorCode":0,
"ConfigTime":"2015-12-11T18:29:15.519Z","ResetTime":null,"BadConnections":0 } ]

The following example uses cURL to show how a GET method is used to create statistics about an internal pre-configured endpoint, !MQConnectivityEndpoint:

curl -X GET http://127.0.0.1:9089/ima/v1/monitor/Endpoint?Name=%21MQConnectivityEndpoint 
 
 
Note: You must encode the special endpoints that start with the character ! with %21 when using the REST API GET method.

The following example shows a successful example response to the GET method that was used to create statistics about !MQConnectivityEndpoint:


{ 
"Version":"v1", "Endpoint": [ { "Name":"!MQConnectivityEndpoint","IPAddr":"127.0.0.1",
"Enabled":true,"Total":0,"Active":0,"Messages":0,"Bytes":0,"LastErrorCode":0,"ConfigTime":"2016-04-27T16:42:33.464-05:00",
"ResetTime":null,"BadConnections":0 }]
}