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 revisionBoth sides next revision
monitors:submqttm [2020/11/13 12:19] – [Installation] wnelismonitors:submqttm [2020/11/13 12:43] – [Installation] wnelis
Line 19: Line 19:
 === 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 topcis 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.
 +<code>
 [Unit] [Unit]
 Description=Xymon client with MQTT input Description=Xymon client with MQTT input
Line 38: Line 38:
 [Install] [Install]
 WantedBy=multi-user.target WantedBy=multi-user.target
-  +</code> 
-Continuously runningas the topics can arrive at any time. + 
-Tests with mode 'periodic' are run once every 5 minutes.+Once file submqttm.service is created, the following two commands are needed to activate the script: 
 +<code> 
 +sudo systemctl start submqttm 
 +sudo systemctl enable submqttm 
 +</code> 
 + 
 +Note that though the script is running continuously, the tests with mode 'periodic' are run once every 5 minutes. 
  
 === Server side === === Server side ===
  
-xymonserver.cfg to be extended +For the initial client, which monitors the throughput of one MQTT broker, two extensions of the xymon server configuration are needed. First, xymonserver.cfg should be extended. This is achieved by adding file mqtt-thr.cfg in directory /usr/lib/xymon/server/etc/xymonserver.d. It' contents is: 
-graphs.cfg to be extended+ 
 +<code> 
 +TEST2RRD+=",mqtt=devmon" 
 +GRAPHS_mqtt="mqtttm,mqttto" 
 +</code> 
 + 
 +Secondly, graphs.cfg should be extended with the definitions of the graphs. In directory /usr/lib/xymon/server/etc/graphs.d (also) a file named mqtt-thr.cfg is created containing the following definitions: 
 + 
 +<code> 
 +[mqtttm] 
 +        TITLE , MQTT message rate 
 +        YAXIS Throughput [p/s] 
 +        -l 0 
 +        DEF:mr=mqtt.broker.message.rrd:Rcv:AVERAGE 
 +        DEF:mx=mqtt.broker.message.rrd:Xmt:AVERAGE 
 +        LINE1:mr#0000FF:ingress 
 +        GPRINT:mr:MIN:Min \: %5.1lf %sp/s 
 +        GPRINT:mr:MAX:Max \: %5.1lf %sp/s 
 +        GPRINT:mr:AVERAGE:Avg \: %5.1lf %sp/s 
 +        GPRINT:mr:LAST:Cur \: %5.1lf %sp/s\n 
 +        LINE1:mx#00FF00:egress 
 +        GPRINT:mx:MIN: Min \: %5.1lf %sp/s 
 +        GPRINT:mx:MAX:Max \: %5.1lf %sp/s 
 +        GPRINT:mx:AVERAGE:Avg \: %5.1lf %sp/s 
 +        GPRINT:mx:LAST:Cur \: %5.1lf %sp/s\n 
 + 
 +[mqttto] 
 +        TITLE , MQTT bit rate 
 +        YAXIS Throughput [b/s] 
 +        -l 0 
 +        DEF:or=mqtt.broker.octet.rrd:Rcv:AVERAGE 
 +        DEF:ox=mqtt.broker.octet.rrd:Xmt:AVERAGE 
 +        CDEF:br=or,8,
 +        CDEF:bx=ox,8,
 +        LINE1:br#0000FF:ingress 
 +        GPRINT:br:MIN:Min \: %5.1lf %sb/s 
 +        GPRINT:br:MAX:Max \: %5.1lf %sb/s 
 +        GPRINT:br:AVERAGE:Avg \: %5.1lf %sb/s 
 +        GPRINT:br:LAST:Cur \: %5.1lf %sb/s\n 
 +        LINE1:bx#00FF00:egress 
 +        GPRINT:bx:MIN: Min \: %5.1lf %sb/s 
 +        GPRINT:bx:MAX:Max \: %5.1lf %sb/s 
 +        GPRINT:bx:AVERAGE:Avg \: %5.1lf %sb/s 
 +        GPRINT:bx:LAST:Cur \: %5.1lf %sb/s\n 
 +</code> 
 + 
 +A small note: typically I'll end each TITLE-line with two spaces. This results in a bigger separation between the title and the date-range, which improves the readability of the top line in the graph. Those two trailing spaces are missing in the above definition of the graphs.
  
 ===== Source ===== ===== Source =====
  • monitors/submqttm.txt
  • Last modified: 2020/11/13 12:48
  • by wnelis