monitors:submqttm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
monitors:submqttm [2020/11/13 12:43] – [Installation] wnelismonitors:submqttm [2020/11/13 12:48] (current) – [Installation] wnelis
Line 8: Line 8:
  
 ===== Description ===== ===== Description =====
-NOTE: this page is under construction, and thus not yet complete. 
- 
  
 Script submqttm.py (short for SUBscribe_to_MQTT_Measurements) is a skeleton for one or more Xymon tests, which receive their measurements via MQTT. An abstract class XymonTest is defined, which handles the receipt of the topics, the detection that all required information is received, and the transmission of the Xymon message to the Xymon server. Per Xymon test a derived class needs to be defined, containing (at least) method BuildMessage, which transforms the measurements received from MQTT into a message to be sent to Xymon. The script contains a receiver thread which subscribes to all required topics, and which calls method XymonTest.Update to handle them. List MqttXymon near the start of the script contains the mapping between MQTT topics and Xymon tests. Script submqttm.py (short for SUBscribe_to_MQTT_Measurements) is a skeleton for one or more Xymon tests, which receive their measurements via MQTT. An abstract class XymonTest is defined, which handles the receipt of the topics, the detection that all required information is received, and the transmission of the Xymon message to the Xymon server. Per Xymon test a derived class needs to be defined, containing (at least) method BuildMessage, which transforms the measurements received from MQTT into a message to be sent to Xymon. The script contains a receiver thread which subscribes to all required topics, and which calls method XymonTest.Update to handle them. List MqttXymon near the start of the script contains the mapping between MQTT topics and Xymon tests.
Line 19: Line 17:
 === Client side === === Client side ===
  
-The source modules submqttm.py and watchdog.py shown in the next chapter are to be installed in directory /usr/lib/xymon/client/ext. Script submqttm.py needs to be running continuously, as the topics can arrive at any time. Thus xymonlaunch is //not// used. In stead, a service is  defined which will start script submqttm.py at system start.+The source modules submqttm.py and watchdog.py shown in the next chapter are to be installed in directory /usr/lib/xymon/client/ext.  
 + 
 +Script submqttm.py needs to be running continuously, as the topics can arrive at any time. Thus xymonlaunch is //not// used. In stead, a service is  defined which will start script submqttm.py at system start.
  
 Service submqttm is defined by creating a file named /etc/systemd/system as super user. An example of the content of this file is shown below. Service submqttm is defined by creating a file named /etc/systemd/system as super user. An example of the content of this file is shown below.
  • monitors/submqttm.txt
  • Last modified: 2020/11/13 12:48
  • by wnelis