Difference between revisions of "Edge Monitoring"

From RifidiWiki

Jump to: navigation, search
(Event Notification via MQTT)
 
(17 intermediate revisions by the same user not shown)
Line 9: Line 9:
  
  
Starting in 3.1 Edge Monitoring is now accessible though Resftful Services (leveraging [http://www.jolokia.org/ Jolokia plugin]. Jolokia exposes all JMX/Mbeans via Rest
+
Starting in Edge 3.1 Monitoring is now accessible though Resftful Services (leveraging [http://www.jolokia.org/ Jolokia plugin]. Jolokia exposes all JMX/Mbeans via Rest
  
 
The types of components which can be monitored include
 
The types of components which can be monitored include
Line 17: Line 17:
 
*Messaging
 
*Messaging
  
 +
Starting in Edge 3.6 event notifications (application and sensor) via MQTT are included.
  
  
 
+
=Rest Configuration via Jolokia=
=Configuration=
+
  
 
Note: Default port changed from 8080 to 8091 in Rifidi 3.1.1 (as 8080 is a popular port used by other web servers such as Tomcat)
 
Note: Default port changed from 8080 to 8091 in Rifidi 3.1.1 (as 8080 is a popular port used by other web servers such as Tomcat)
Line 29: Line 29:
 
Jolokia port
 
Jolokia port
  
=Examples=
+
=Rest Examples via Jolokia=
 
Example calls are:
 
Example calls are:
  
Line 39: Line 39:
 
Additional features can be found on [http://www.jolokia.org/reference/html/protocol.html#request-response Jolokia Get/Post Features ]
 
Additional features can be found on [http://www.jolokia.org/reference/html/protocol.html#request-response Jolokia Get/Post Features ]
  
=Event Notification via MQTT=
+
=Event Notification via MQTT (released in Edge 3.6)=
  
The feature is used to publish Reader and Rifidi application events to a configurable MQTT topic end point. An example could be notifying via MQTT message topic that a reader has gone into a disconnected state which may mean a reader has lost connectivity, hardware and/or network issues in real-time.
+
The feature is used to publish Server KeepAlive, Reader and Rifidi application events to a configurable MQTT topic end point. An example could be notifying via MQTT message topic that a reader has gone into a disconnected state which may mean a reader has lost connectivity, hardware and/or network issues in real-time.
  
 
Notification App Property Settings
 
Notification App Property Settings
 +
 +
<b> Note: Disabled by default - set mqttnotifier.global.disable to false to enable (found in applications/Monitoring/MqttNotifierApp.properties</b>
 
<pre>
 
<pre>
 
mqttnotifier.qos=2
 
mqttnotifier.qos=2
Line 51: Line 53:
  
 
#disable all notifications
 
#disable all notifications
mqttnotifier.global.disable=true Note: Disabled by default - set to false to enable
+
mqttnotifier.global.disable=false
  
 
#disable individual notification types
 
#disable individual notification types
Line 60: Line 62:
 
mqttnotifier.app.started.disable=false
 
mqttnotifier.app.started.disable=false
 
mqttnotifier.app.stopped.disable=false
 
mqttnotifier.app.stopped.disable=false
 +
mqttnotifier.keepalive.disable=false
 +
mqttnotifier.readerexception.disable=false
 +
 +
#Name for the edge server
 +
mqttnotifier.keepalive.name=Edge Server
 +
mqttnotifier.keepalive.timeout=20000
 
</pre>
 
</pre>
  
* Rifidi Application Notifications  
+
==Rifidi Application Notifications==
  
 
Example Rifidi Application Started Event - This means the Rifidi App has started.  
 
Example Rifidi Application Started Event - This means the Rifidi App has started.  
Line 74: Line 82:
 
</pre>
 
</pre>
  
* Sensor Notifications
+
==Sensor Notifications==
  
 
Sensor State Life-cycle
 
Sensor State Life-cycle
# Closed
+
# Created - Once sensor is created and session has never been started
# Connecting
+
# Closed - Session has been closed
# Loggingin
+
# Connecting - Attempting to start session
# Processing
+
# Loggingin - Intermediate state prior to starting session
 +
# Processing - Session successfully started and ready to process tags
  
 
Example Reader Connecting Event - This means the sensor is attempting to connect.
 
Example Reader Connecting Event - This means the sensor is attempting to connect.
 
<pre>
 
<pre>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <sensorconnectingdto> <sensor>LLRP_1</sensor> <timestamp>1481636928990</timestamp> <ip>192.168.1.124</ip> </sensorconnectingdto>
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <sensorconnecting> <sensor>LLRP_1</sensor> <timestamp>1483620651189</timestamp> <ip>192.168.1.228</ip> </sensorconnecting>
 
</pre>
 
</pre>
  
Line 101: Line 110:
 
<pre>
 
<pre>
 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <sensorclosed> <sensor>LLRP_1</sensor> <timestamp>1481553326093</timestamp> <ip>192.168.1.124</ip> </sensorclosed>
 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <sensorclosed> <sensor>LLRP_1</sensor> <timestamp>1481553326093</timestamp> <ip>192.168.1.124</ip> </sensorclosed>
 +
</pre>
 +
 +
==Server Notifications (released in Edge 3.7)==
 +
 +
Example Server KeepAlive Event  - Used to notify an RIfidi Edge Server is still up.
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 +
<keepalive>
 +
  <ip>127.0.0.1</ip>
 +
  <name>Edge Server</name>
 +
  <timestamp>1516854152164</timestamp>
 +
  <uptime>15</uptime> ## In Milliseconds
 +
</keepalive>
 +
</pre>
 +
 +
==Reader Exception Notifications (released in Edge 3.7)==
 +
 +
Example Server KeepAlive Event  - Used to notify an RIfidi Edge Server is still up.
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 +
<readerexception>
 +
  <sensor>LLRP_1</sensor>
 +
  <errordescription>Reader Error</errordescription>
 +
  <statuscode>1</statuscode>
 +
  <timestamp>1516854152164</timestamp>
 +
</readerexception>
 +
 
</pre>
 
</pre>

Latest revision as of 15:48, 2 August 2018

Introduction

In all versions Edge Monitoring is available through JMX/MBeans via RMI.

Note: The Edge Server can also be monitored via JConsole: https://docs.oracle.com/javase/8/docs/technotes/guides/management/jconsole.html

Remote process connection string: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi



Starting in Edge 3.1 Monitoring is now accessible though Resftful Services (leveraging Jolokia plugin. Jolokia exposes all JMX/Mbeans via Rest

The types of components which can be monitored include

  • Java Virtual Machine (Memory, CPU etc..)
  • Sensors/Readers (Status, Properties etc..)
  • OSGI (Status, Applications etc..)
  • Messaging

Starting in Edge 3.6 event notifications (application and sensor) via MQTT are included.


Rest Configuration via Jolokia

Note: Default port changed from 8080 to 8091 in Rifidi 3.1.1 (as 8080 is a popular port used by other web servers such as Tomcat) In rifidiserver.ini - A full list of Rifidi Edge configuration parameters can be found Edge_Server_Configuration


-Dorg.osgi.service.http.port=8091

Jolokia port

Rest Examples via Jolokia

Example calls are:


Additional features can be found on Jolokia Get/Post Features

Event Notification via MQTT (released in Edge 3.6)

The feature is used to publish Server KeepAlive, Reader and Rifidi application events to a configurable MQTT topic end point. An example could be notifying via MQTT message topic that a reader has gone into a disconnected state which may mean a reader has lost connectivity, hardware and/or network issues in real-time.

Notification App Property Settings

Note: Disabled by default - set mqttnotifier.global.disable to false to enable (found in applications/Monitoring/MqttNotifierApp.properties

mqttnotifier.qos=2
mqttnotifier.broker=tcp://localhost:1883
mqttnotifier.clientid=MyAppRifidiServicesId
mqttnotifier.topic=notifications

#disable all notifications
mqttnotifier.global.disable=false

#disable individual notification types
mqttnotifier.processing.disable=false
mqttnotifier.closed.disable=false
mqttnotifier.connecting.disable=false
mqttnotifier.loggingin.disable=false
mqttnotifier.app.started.disable=false
mqttnotifier.app.stopped.disable=false
mqttnotifier.keepalive.disable=false
mqttnotifier.readerexception.disable=false

#Name for the edge server
mqttnotifier.keepalive.name=Edge Server
mqttnotifier.keepalive.timeout=20000

Rifidi Application Notifications

Example Rifidi Application Started Event - This means the Rifidi App has started.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <appstarted> <group>Monitoring</group> <name>StatsApp</name> <timestamp>1481553095850</timestamp> <ip>192.168.1.124</ip> </appstarted>

Example Rifidi Application Stopped Event - This means the Rifidi App has stopped.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <appstopped> <group>Monitoring</group> <name>StatsApp</name> <timestamp>1481553071272</timestamp> <ip>192.168.1.124</ip> </appstopped>

Sensor Notifications

Sensor State Life-cycle

  1. Created - Once sensor is created and session has never been started
  2. Closed - Session has been closed
  3. Connecting - Attempting to start session
  4. Loggingin - Intermediate state prior to starting session
  5. Processing - Session successfully started and ready to process tags

Example Reader Connecting Event - This means the sensor is attempting to connect.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <sensorconnecting> <sensor>LLRP_1</sensor> <timestamp>1483620651189</timestamp> <ip>192.168.1.228</ip> </sensorconnecting>

Example Reader Logging in Event - This means the sensor is attempting to log in. (last state before entering processing state)

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <sensorloggingin> <sensor>LLRP_1</sensor> <timestamp>1481636929123</timestamp> <ip>192.168.1.124</ip> </sensorloggingin>


Example Reader Processing Event - This means the sensor has gone into a processing state by the session connecting.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <sensorprocessing> <sensor>LLRP_1</sensor> <timestamp>1481553161280</timestamp> <ip>192.168.1.124</ip> </sensorprocessing>

Example Reader Closed Event - This means the sensor has gone into a closed state by the session disconnecting..

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <sensorclosed> <sensor>LLRP_1</sensor> <timestamp>1481553326093</timestamp> <ip>192.168.1.124</ip> </sensorclosed>

Server Notifications (released in Edge 3.7)

Example Server KeepAlive Event - Used to notify an RIfidi Edge Server is still up.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<keepalive>
   <ip>127.0.0.1</ip>
   <name>Edge Server</name>
   <timestamp>1516854152164</timestamp>
   <uptime>15</uptime> ## In Milliseconds
</keepalive>

Reader Exception Notifications (released in Edge 3.7)

Example Server KeepAlive Event - Used to notify an RIfidi Edge Server is still up.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<readerexception>
   <sensor>LLRP_1</sensor>
   <errordescription>Reader Error</errordescription>
   <statuscode>1</statuscode> 
   <timestamp>1516854152164</timestamp>
</readerexception>

Personal tools