Difference between revisions of "Edge Monitoring"
From RifidiWiki
(→Event Notification via MQTT) |
(→Event Notification via MQTT) |
||
Line 51: | Line 51: | ||
#disable all notifications | #disable all notifications | ||
− | mqttnotifier.global.disable=true | + | mqttnotifier.global.disable=true Note: Disabled by default - set to false to enable |
#disable individual notification types | #disable individual notification types |
Revision as of 12:47, 5 January 2017
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 3.1 Edge 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
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) 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
Examples
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
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.
Notification App Property Settings
mqttnotifier.qos=2 mqttnotifier.broker=tcp://localhost:1883 mqttnotifier.clientid=MyAppRifidiServicesId mqttnotifier.topic=notifications #disable all notifications mqttnotifier.global.disable=true Note: Disabled by default - set to false to enable #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
- 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
- Closed
- Connecting
- Loggingin
- Processing
Example Reader Connecting Event - This means the sensor is attempting to connect.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <sensorconnectingdto> <sensor>LLRP_1</sensor> <timestamp>1481636928990</timestamp> <ip>192.168.1.124</ip> </sensorconnectingdto>
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>