summaryrefslogtreecommitdiffstats
path: root/mqttwarn.ini
diff options
context:
space:
mode:
authorsteve <steve@haxors.club>2024-07-06 16:29:00 +0100
committersteve <steve@haxors.club>2024-07-06 16:29:00 +0100
commitc48a265bb82fde1403a757ecc4e2daed909dbb9c (patch)
tree0722acd71023252c313976dc4f857b6127c58cfc /mqttwarn.ini
downloadsspmon-c48a265bb82fde1403a757ecc4e2daed909dbb9c.tar.gz
sspmon-c48a265bb82fde1403a757ecc4e2daed909dbb9c.tar.bz2
sspmon-c48a265bb82fde1403a757ecc4e2daed909dbb9c.zip
Initial commitHEADmaster
Diffstat (limited to 'mqttwarn.ini')
-rw-r--r--mqttwarn.ini185
1 files changed, 185 insertions, 0 deletions
diff --git a/mqttwarn.ini b/mqttwarn.ini
new file mode 100644
index 0000000..cdf7a76
--- /dev/null
+++ b/mqttwarn.ini
@@ -0,0 +1,185 @@
+# -*- coding: utf-8 -*-
+# (c) 2014-2022 The mqttwarn developers
+#
+# mqttwarn example configuration file "mqttwarn.ini"
+#
+
+; ------------------------------------------
+; Base configuration
+; ------------------------------------------
+
+[defaults]
+
+
+; ----
+; MQTT
+; ----
+
+hostname = '192.168.1.3'
+port = 1883
+username = None
+password = None
+clientid = 'mqttwarn'
+lwt = 'clients/mqttwarn'
+skipretained = False
+cleansession = False
+
+# MQTTv31 = 3 (default)
+# MQTTv311 = 4
+protocol = 3
+
+
+; -------
+; Logging
+; -------
+
+; Send log output to STDERR
+logfile = 'stream://sys.stderr'
+
+; Send log output to file
+;logfile = 'mqttwarn.log'
+
+; one of: CRITICAL, DEBUG, ERROR, INFO, WARN
+loglevel = DEBUG
+
+; optionally set the log level for filtered messages, defaults to INFO
+;filteredmessagesloglevel = DEBUG
+
+;logformat = '%(asctime)-15s %(levelname)-8s [%(name)-25s] %(message)s'
+
+
+; --------
+; Services
+; --------
+
+; path to file containing self-defined functions like `format` or `alldata`
+functions = 'udf.py'
+
+; name the service providers you will be using.
+launch = file, log, smtp
+
+; Publish mqttwarn status information (retained)
+status_publish = True
+; status_topic = mqttwarn/$SYS
+
+
+
+; -------
+; Targets
+; -------
+
+[config:file]
+append_newline = True
+targets = {
+ 'f01' : ['/tmp/f.01'],
+ 'log-me' : ['/tmp/log.me'],
+ 'mqttwarn' : ['/tmp/mqttwarn.err'],
+ }
+
+[config:log]
+targets = {
+ 'debug' : [ 'debug' ],
+ 'info' : [ 'info' ],
+ 'warn' : [ 'warn' ],
+ 'crit' : [ 'crit' ],
+ 'error' : [ 'error' ]
+ }
+
+; special config for 'failover' events
+[failover]
+targets = log:error, file:mqttwarn
+
+
+[config:smtp]
+server = 'mail.bleg.com:587'
+sender = "MQTTwarn <digest@bleg.com>"
+username = digest@bleg.com
+password = CHANGE_ME
+starttls = True
+# Optional send msg as html or only plain text
+htmlmsg = False
+targets = {
+ 'digest' : [ 'digest@bleg.com' ],
+ }
+
+
+; ------------------------------------------
+; Basic
+; ------------------------------------------
+
+[hello/1]
+; echo '{"name": "temperature", "number": 42.42}' | mosquitto_pub -h localhost -t hello/1 -l
+targets = log:info
+format = '{name}: {number} => {_dthhmm}'
+
+
+; ------------------------------------------
+; OwnTracks
+; ------------------------------------------
+
+[owntracks-location]
+topic = owntracks/+/+
+targets = log:info, file:f01
+datamap = OwnTracksTopic2Data()
+format = OwnTracksConvert()
+
+[owntracks-battery]
+topic = owntracks/+/+
+targets = log:info, file:f01
+datamap = OwnTracksTopic2Data()
+filter = OwnTracksBattFilter()
+format = {username}'s phone battery is getting low ({batt}%)
+
+
+; ------------------------------------------
+; Dynamic targets
+; ------------------------------------------
+
+[robustness-1]
+; even if "foo" is considered an invalid service or
+; "log:baz" is considered an invalid service target,
+; mqttwarn should keep calm and carry on
+topic = test/robustness-1
+targets = foo:bar, log:baz
+
+[topic-targets-dynamic]
+; interpolate transformation data values into topic target, example:
+; mosquitto_pub -t test/topic-targets-dynamic -m '{"loglevel": "crit", "message": "Nur Döner macht schöner!"}'
+topic = test/topic-targets-dynamic
+format = Something {loglevel} happened! {message}
+targets = log:{loglevel}
+
+[topic-targets-func]
+; use functions for computing topic targets, example:
+; mosquitto_pub -t test/topic-targets-func -m '{"condition": "sunny", "remark": "This should go to a file"}'
+; mosquitto_pub -t test/topic-targets-func -m '{"condition": "rainy", "remark": "This should go to the log"}'
+topic = test/topic-targets-func
+format = Weather conditions changed: It's {condition}. Remark: {remark}
+targets = TopicTargetList()
+
+
+; ------------------------------------------
+; Periodic tasks
+; ------------------------------------------
+
+[cron]
+; Demonstrate periodic task feature.
+; Define a function for publishing your public ip address to the MQTT bus each minute.
+; mosquitto_sub -t 'test/ip/#' -v
+#publish_public_ip_address = 60; now=true
+
+[sspmon/ssps/active]
+; ----
+; SSPMon
+; ----
+topic = sspmon/ssps/active
+targets = smtp:digest
+template = active.j2
+
+[sspmon/ssps/expired]
+; ----
+; SSPMon
+; ----
+topic = sspmon/ssps/expired
+targets = smtp:digest
+template = active.j2