Difference between revisions of "Edge Monitoring"
From RifidiWiki
(→Configuration) |
|||
(37 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=Introduction= | =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 [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 8: | Line 17: | ||
*Messaging | *Messaging | ||
− | =Configuration= | + | 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) | 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 | + | In rifidiserver.ini - A full list of Rifidi Edge configuration parameters can be found [[Edge_Server_Configuration]] |
− | ;-Dorg. | + | ;-Dorg.osgi.service.http.port=8091 |
Jolokia port | Jolokia port | ||
− | =Examples= | + | =Rest Examples via Jolokia= |
Example calls are: | Example calls are: | ||
Line 26: | Line 38: | ||
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 (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 | ||
+ | |||
+ | <b> Note: Disabled by default - set mqttnotifier.global.disable to false to enable (found in applications/Monitoring/MqttNotifierApp.properties</b> | ||
+ | <pre> | ||
+ | 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 | ||
+ | </pre> | ||
+ | |||
+ | ==Rifidi Application Notifications== | ||
+ | |||
+ | Example Rifidi Application Started Event - This means the Rifidi App has started. | ||
+ | <pre> | ||
+ | <?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> | ||
+ | </pre> | ||
+ | |||
+ | Example Rifidi Application Stopped Event - This means the Rifidi App has stopped. | ||
+ | <pre> | ||
+ | <?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> | ||
+ | </pre> | ||
+ | |||
+ | ==Sensor Notifications== | ||
+ | |||
+ | Sensor State Life-cycle | ||
+ | # Created - Once sensor is created and session has never been started | ||
+ | # Closed - Session has been closed | ||
+ | # Connecting - Attempting to start session | ||
+ | # 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. | ||
+ | <pre> | ||
+ | <?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> | ||
+ | |||
+ | Example Reader Logging in Event - This means the sensor is attempting to log in. (last state before entering processing state) | ||
+ | <pre> | ||
+ | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <sensorloggingin> <sensor>LLRP_1</sensor> <timestamp>1481636929123</timestamp> <ip>192.168.1.124</ip> </sensorloggingin> | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | Example Reader Processing Event - This means the sensor has gone into a processing state by the session connecting. | ||
+ | <pre> | ||
+ | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <sensorprocessing> <sensor>LLRP_1</sensor> <timestamp>1481553161280</timestamp> <ip>192.168.1.124</ip> </sensorprocessing> | ||
+ | </pre> | ||
+ | |||
+ | Example Reader Closed Event - This means the sensor has gone into a closed state by the session disconnecting.. | ||
+ | <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> | ||
+ | </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> |
Latest revision as of 15:48, 2 August 2018
Contents
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:
- Java Virtual Machine HeapMemory Usage example URL - http://localhost:8091/jolokia/read/java.lang:type=Memory/HeapMemoryUsage/used
- To find all available MBeans list example URL - http://localhost:8091/jolokia/search/*,*
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
- Created - Once sensor is created and session has never been started
- Closed - Session has been closed
- Connecting - Attempting to start session
- 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.
<?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>