From 9a96add49c5af1317e9a0a216ce8cdd056dae136 Mon Sep 17 00:00:00 2001 From: Jaxom99 <30865395+Jaxom99@users.noreply.github.com> Date: Thu, 28 Apr 2022 16:35:30 +0200 Subject: [PATCH 1/7] Update app MQTT page 1 error in the code (escaping the $SYS topic) and some style changes for better understanding. --- .../index.html | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/docs/templates/applications-template-mqtt-mosquitto-broker-monitoring/index.html b/docs/templates/applications-template-mqtt-mosquitto-broker-monitoring/index.html index 2e9ca8d42..0ffe1434e 100644 --- a/docs/templates/applications-template-mqtt-mosquitto-broker-monitoring/index.html +++ b/docs/templates/applications-template-mqtt-mosquitto-broker-monitoring/index.html @@ -86,37 +86,35 @@

Overview

A very simple template+script for monitoring mosquitto.

-

CONFIG

+

CONFIG

-

/etc/zabbix/zabbix-agent.d/userparams_mosquitto.conf

+

On your system, create this first file : /etc/zabbix/zabbix-agent.d/userparams_mosquitto.conf

-

======================= CUT HERE ================================

+

======================= File BEGIN ================================

-

Mosquitto monitoring

+

#

Mosquitto monitoring

-

#

-

This content is licensed GNU GPL v2

+

#

This content is licensed GNU GPL v2

-

Author: Guido Rizzi (guido.rizzi@studiorizzi.net)

+

#

Author: Guido Rizzi (guido.rizzi@studiorizzi.net)

-

#

-

UserParameter=mosquitto[*],/etc/zabbix/scripts/mosquitto $SYS/broker/$1 2>/dev/null

+

UserParameter=mosquitto[*],/etc/zabbix/scripts/mosquitto \$SYS/broker/$1 2>/dev/null

-

======================= CUT HERE ================================

+

======================= File END ================================

-

SCRIPT

+

SCRIPT

-

/etc/zabbix/scripts/mosquitto

+

and this second file /etc/zabbix/scripts/mosquitto

-

======================= CUT HERE ================================

+

======================= File BEGIN ================================

#!/bin/bash

mosquitto_sub -C 1 -u USERNAME -P PASSWORD -t “$1”

-

======================= CUT HERE ================================

+

======================= File END ================================

Macros used

@@ -681,4 +679,4 @@

Triggers

- \ No newline at end of file + From 68c7bd9af111b9b3c7d0d1f5f17f3d1b54b8cd5f Mon Sep 17 00:00:00 2001 From: Jaxom99 <30865395+Jaxom99@users.noreply.github.com> Date: Thu, 28 Apr 2022 16:46:50 +0200 Subject: [PATCH 2/7] Correct display to avoid code errors Escaping and .md interpretation allow for some errors in code afterwards. This is a proposal for improvement :) --- .../5.0/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Applications/template_mqtt_(mosquitto)_broker_monitoring/5.0/README.md b/Applications/template_mqtt_(mosquitto)_broker_monitoring/5.0/README.md index 02f3bcafd..ffab2b015 100644 --- a/Applications/template_mqtt_(mosquitto)_broker_monitoring/5.0/README.md +++ b/Applications/template_mqtt_(mosquitto)_broker_monitoring/5.0/README.md @@ -30,7 +30,7 @@ CONFIG ======================= CUT HERE ================================ - +``` # Mosquitto monitoring @@ -48,7 +48,7 @@ CONFIG UserParameter=mosquitto[*],/etc/zabbix/scripts/mosquitto \$SYS/broker/$1 2>/dev/null - +``` ======================= CUT HERE ================================ @@ -63,13 +63,13 @@ SCRIPT ======================= CUT HERE ================================ - +``` #!/bin/bash -mosquitto\_sub -C 1 -u USERNAME -P PASSWORD -t "$1" - +mosquitto_sub -C 1 -u USERNAME -P PASSWORD -t "$1" +``` ======================= CUT HERE ================================ From e2389ca651969117f454e478170c4bedb8bd5459 Mon Sep 17 00:00:00 2001 From: Jaxom99 <30865395+Jaxom99@users.noreply.github.com> Date: Thu, 28 Apr 2022 16:47:51 +0200 Subject: [PATCH 3/7] Correction of MD display same errors --- .../5.4/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Applications/template_mqtt_(mosquitto)_broker_monitoring/5.4/README.md b/Applications/template_mqtt_(mosquitto)_broker_monitoring/5.4/README.md index fa3ec5fe4..436ce5e6b 100644 --- a/Applications/template_mqtt_(mosquitto)_broker_monitoring/5.4/README.md +++ b/Applications/template_mqtt_(mosquitto)_broker_monitoring/5.4/README.md @@ -31,7 +31,7 @@ CONFIG ======================= CUT HERE ================================ - +``` # Mosquitto monitoring @@ -49,7 +49,7 @@ CONFIG UserParameter=mosquitto[*],/etc/zabbix/scripts/mosquitto \$SYS/broker/$1 2>/dev/null - +``` ======================= CUT HERE ================================ @@ -64,12 +64,12 @@ SCRIPT ======================= CUT HERE ================================ - +``` #!/bin/bash -mosquitto\_sub -C 1 -u USERNAME -P PASSWORD -t "$1" - +mosquitto_sub -C 1 -u USERNAME -P PASSWORD -t "$1" +``` ======================= CUT HERE ================================ From 9889669a1276e66709e4aa15cede15e16af2ebc2 Mon Sep 17 00:00:00 2001 From: Jaxom99 <30865395+Jaxom99@users.noreply.github.com> Date: Thu, 28 Apr 2022 16:48:34 +0200 Subject: [PATCH 4/7] Correct MD display same errors --- .../6.0/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Applications/template_mqtt_(mosquitto)_broker_monitoring/6.0/README.md b/Applications/template_mqtt_(mosquitto)_broker_monitoring/6.0/README.md index fa3ec5fe4..c237c8221 100644 --- a/Applications/template_mqtt_(mosquitto)_broker_monitoring/6.0/README.md +++ b/Applications/template_mqtt_(mosquitto)_broker_monitoring/6.0/README.md @@ -30,7 +30,7 @@ CONFIG ======================= CUT HERE ================================ - +``` # Mosquitto monitoring @@ -49,7 +49,7 @@ CONFIG UserParameter=mosquitto[*],/etc/zabbix/scripts/mosquitto \$SYS/broker/$1 2>/dev/null - +``` ======================= CUT HERE ================================ @@ -64,12 +64,12 @@ SCRIPT ======================= CUT HERE ================================ - +``` #!/bin/bash -mosquitto\_sub -C 1 -u USERNAME -P PASSWORD -t "$1" - +mosquitto_sub -C 1 -u USERNAME -P PASSWORD -t "$1" +``` ======================= CUT HERE ================================ From 04c6687d7df1a7396a33bd8db70af5ea61017ce2 Mon Sep 17 00:00:00 2001 From: Jaxom99 <30865395+Jaxom99@users.noreply.github.com> Date: Thu, 28 Apr 2022 17:11:04 +0200 Subject: [PATCH 5/7] Typo in MQTT topic remove just one / --- .../5.0/template_mqtt_(mosquitto)_broker_monitoring.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Applications/template_mqtt_(mosquitto)_broker_monitoring/5.0/template_mqtt_(mosquitto)_broker_monitoring.xml b/Applications/template_mqtt_(mosquitto)_broker_monitoring/5.0/template_mqtt_(mosquitto)_broker_monitoring.xml index ff790c474..b5a0a1341 100644 --- a/Applications/template_mqtt_(mosquitto)_broker_monitoring/5.0/template_mqtt_(mosquitto)_broker_monitoring.xml +++ b/Applications/template_mqtt_(mosquitto)_broker_monitoring/5.0/template_mqtt_(mosquitto)_broker_monitoring.xml @@ -77,4 +77,4 @@ mosquitto\_sub -C 1 -u USERNAME -P PASSWORD -t "$1" -TemplatesMQTTMQTT Messages Sentmosquitto[/messages/sent]30FLOATMQTTMQTT Clients Disconnectedmosquitto[clients/disconnected]30FLOATMQTTMQTT Clients Expiredmosquitto[clients/expired]30MQTTMQTT Clients Maxmosquitto[clients/maximum]30MQTTMQTT Clients Totalmosquitto[clients/total]30MQTTMQTT AVG Bytes Receivedmosquitto[load/bytes/received/5min]30FLOATBMQTTMQTT AVG Bytes Sentmosquitto[load/bytes/sent/5min]30FLOATBMQTTMQTT AVG Messages Receivedmosquitto[load/messages/received/5min]30FLOATMQTTMQTT AVG Messages Sentmosquitto[load/messages/sent/5min]30FLOATMQTTMQTT Publish Droppedmosquitto[load/publish//dropped/5min]30FLOATMQTTMQTT Publish Receivedmosquitto[load/publish/received/5min]30FLOATMQTTMQTT Publish Sentmosquitto[load/publish/sent/5min]30FLOATMQTTMQTT Messages Inflightmosquitto[messages/inflight]30FLOATMQTTMQTT Messages Receivedmosquitto[messages/received]30FLOATMQTTMQTT Messages Storedmosquitto[messages/stored]30MQTTMQTT Count Retainedmosquitto[retained/messages/count]30MQTTMQTT Count Subscriptionsmosquitto[subscriptions/count]30MQTTMQTT ClientsCCCC00App MQTT Servicemosquitto[clients/maximum]100CC00App MQTT Servicemosquitto[clients/total]22774A4App MQTT Servicemosquitto[clients/expired]3A54F10App MQTT Servicemosquitto[clients/disconnected]MQTT Messages Counts00CC00App MQTT Servicemosquitto[/messages/sent]1A54F10App MQTT Servicemosquitto[messages/inflight]23333FFApp MQTT Servicemosquitto[messages/stored]MQTT Messages Stats1CCCC00App MQTT Servicemosquitto[load/messages/received/5min]200CC00App MQTT Servicemosquitto[load/messages/sent/5min]MQTT Publish CountsDD0000App MQTT Servicemosquitto[load/publish//dropped/5min]1EEEE00App MQTT Servicemosquitto[load/publish/received/5min]200DD00App MQTT Servicemosquitto[load/publish/sent/5min]MQTT Traffic CountsCCCC00App MQTT Servicemosquitto[load/bytes/received/5min]100CC00App MQTT Servicemosquitto[load/bytes/sent/5min] +TemplatesMQTTMQTT Messages Sentmosquitto[messages/sent]30FLOATMQTTMQTT Clients Disconnectedmosquitto[clients/disconnected]30FLOATMQTTMQTT Clients Expiredmosquitto[clients/expired]30MQTTMQTT Clients Maxmosquitto[clients/maximum]30MQTTMQTT Clients Totalmosquitto[clients/total]30MQTTMQTT AVG Bytes Receivedmosquitto[load/bytes/received/5min]30FLOATBMQTTMQTT AVG Bytes Sentmosquitto[load/bytes/sent/5min]30FLOATBMQTTMQTT AVG Messages Receivedmosquitto[load/messages/received/5min]30FLOATMQTTMQTT AVG Messages Sentmosquitto[load/messages/sent/5min]30FLOATMQTTMQTT Publish Droppedmosquitto[load/publish//dropped/5min]30FLOATMQTTMQTT Publish Receivedmosquitto[load/publish/received/5min]30FLOATMQTTMQTT Publish Sentmosquitto[load/publish/sent/5min]30FLOATMQTTMQTT Messages Inflightmosquitto[messages/inflight]30FLOATMQTTMQTT Messages Receivedmosquitto[messages/received]30FLOATMQTTMQTT Messages Storedmosquitto[messages/stored]30MQTTMQTT Count Retainedmosquitto[retained/messages/count]30MQTTMQTT Count Subscriptionsmosquitto[subscriptions/count]30MQTTMQTT ClientsCCCC00App MQTT Servicemosquitto[clients/maximum]100CC00App MQTT Servicemosquitto[clients/total]22774A4App MQTT Servicemosquitto[clients/expired]3A54F10App MQTT Servicemosquitto[clients/disconnected]MQTT Messages Counts00CC00App MQTT Servicemosquitto[/messages/sent]1A54F10App MQTT Servicemosquitto[messages/inflight]23333FFApp MQTT Servicemosquitto[messages/stored]MQTT Messages Stats1CCCC00App MQTT Servicemosquitto[load/messages/received/5min]200CC00App MQTT Servicemosquitto[load/messages/sent/5min]MQTT Publish CountsDD0000App MQTT Servicemosquitto[load/publish//dropped/5min]1EEEE00App MQTT Servicemosquitto[load/publish/received/5min]200DD00App MQTT Servicemosquitto[load/publish/sent/5min]MQTT Traffic CountsCCCC00App MQTT Servicemosquitto[load/bytes/received/5min]100CC00App MQTT Servicemosquitto[load/bytes/sent/5min] From eaecde67bb4063d9c6dd4782dacf52a9d32a7ddf Mon Sep 17 00:00:00 2001 From: Jaxom99 <30865395+Jaxom99@users.noreply.github.com> Date: Thu, 28 Apr 2022 17:12:14 +0200 Subject: [PATCH 6/7] Typos in topic Same error --- .../6.0/template_mqtt_(mosquitto)_broker_monitoring.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Applications/template_mqtt_(mosquitto)_broker_monitoring/6.0/template_mqtt_(mosquitto)_broker_monitoring.yaml b/Applications/template_mqtt_(mosquitto)_broker_monitoring/6.0/template_mqtt_(mosquitto)_broker_monitoring.yaml index 3605b4a12..9dadbf035 100644 --- a/Applications/template_mqtt_(mosquitto)_broker_monitoring/6.0/template_mqtt_(mosquitto)_broker_monitoring.yaml +++ b/Applications/template_mqtt_(mosquitto)_broker_monitoring/6.0/template_mqtt_(mosquitto)_broker_monitoring.yaml @@ -97,7 +97,7 @@ zabbix_export: - uuid: f4a87381e08749dd8c88ce6148967548 name: 'MQTT Messages Sent' - key: 'mosquitto[/messages/sent]' + key: 'mosquitto[messages/sent]' delay: '30' value_type: FLOAT tags: @@ -296,7 +296,7 @@ zabbix_export: color: 00CC00 item: host: 'App MQTT Service' - key: 'mosquitto[/messages/sent]' + key: 'mosquitto[messages/sent]' - sortorder: '1' color: A54F10 From dbbc4b1b6e8a041e01e2f578f07edb97d7259f53 Mon Sep 17 00:00:00 2001 From: Jaxom99 <30865395+Jaxom99@users.noreply.github.com> Date: Thu, 28 Apr 2022 17:13:11 +0200 Subject: [PATCH 7/7] Typosin topic same errors --- .../5.4/template_mqtt_(mosquitto)_broker_monitoring.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Applications/template_mqtt_(mosquitto)_broker_monitoring/5.4/template_mqtt_(mosquitto)_broker_monitoring.yaml b/Applications/template_mqtt_(mosquitto)_broker_monitoring/5.4/template_mqtt_(mosquitto)_broker_monitoring.yaml index a9d7cea6c..afc2f0d21 100644 --- a/Applications/template_mqtt_(mosquitto)_broker_monitoring/5.4/template_mqtt_(mosquitto)_broker_monitoring.yaml +++ b/Applications/template_mqtt_(mosquitto)_broker_monitoring/5.4/template_mqtt_(mosquitto)_broker_monitoring.yaml @@ -97,7 +97,7 @@ zabbix_export: - uuid: f4a87381e08749dd8c88ce6148967548 name: 'MQTT Messages Sent' - key: 'mosquitto[/messages/sent]' + key: 'mosquitto[messages/sent]' delay: '30' value_type: FLOAT tags: @@ -296,7 +296,7 @@ zabbix_export: color: 00CC00 item: host: 'App MQTT Service' - key: 'mosquitto[/messages/sent]' + key: 'mosquitto[messages/sent]' - sortorder: '1' color: A54F10