Eerste versie

This commit is contained in:
2022-10-28 08:30:22 +02:00
parent de75a01de7
commit 4d8224d1cc
31 changed files with 1638 additions and 2 deletions

View File

@@ -0,0 +1,76 @@
# Logging
logging:
# logfile: 'conf/mqttexperter.log' # Optional default '' (stdout)
level: 'debug' # Optional default 'info'
timescale: 0
# Metric definitions
metrics:
- name: 'ftp_transferred_bytes'
help: 'data transferred in bytes pe file'
type: 'summary'
topic: 'ftp/+/transferred'
label_configs:
- source_labels: ['__msg_topic__']
target_label: '__topic__'
- source_labels: ["__msg_topic__"]
regex: "ftp/([^/]+).*"
target_label: "file"
replacement: '\1'
action: "replace"
- name: 'network_ping_ms'
help: 'ping response in ms'
type: 'histogram'
topic: 'network/+/+/ping'
buckets: '0.5,5,10'
label_configs:
- source_labels: ['__msg_topic__']
target_label: '__topic__'
- source_labels: ["__msg_topic__"]
regex: "network/([^/]+).*"
target_label: "network"
replacement: '\1'
action: "replace"
- source_labels: ["__msg_topic__"]
regex: "network/[^/]+/([^/]+).*"
target_label: "server"
replacement: '\1'
action: "replace"
- name: "fhem_temperature_celsius"
help: "443 Mhz Sensors, Temperature in C"
type: "gauge"
topic: "fhem/+/+/temperature"
label_configs:
- source_labels: ['__msg_topic__']
target_label: '__topic__'
- source_labels: ["__msg_topic__"]
regex: "fhem/([^/]+).*"
target_label: "location"
replacement: '\1'
action: "replace"
- name: "fhem_humidity_percent"
help: "443 Mhz Sensors, Humidity in %"
type: "gauge"
topic: "fhem/+/+/humidity"
label_configs:
- source_labels: ['__msg_topic__']
target_label: '__topic__'
- source_labels: ["__msg_topic__"]
regex: "fhem/([^/]+).*"
target_label: "location"
replacement: '\1'
action: "replace"
- name: "fhem_rain_mm"
help: "443 Mhz Sensors, rain in mm/m2"
type: "counter"
topic: "fhem/+/+/rain_total"
label_configs:
- source_labels: ['__msg_topic__']
target_label: '__topic__'
- source_labels: ["__msg_topic__"]
regex: "fhem/([^/]+).*"
target_label: "location"
replacement: '\1'
action: "replace"

View File

@@ -0,0 +1,26 @@
in_topic;in_payload;out_name;out_labels;out_value;delay;assert
fhem/Terrasse/TermPearl02/temperature;18;fhem_temperature_celsius;{"location": "Terrasse","topic": "fhem/Terrasse/TermPearl02/temperature"};18;1;True
fhem/Terrasse/TermPearl02/humidity;21;fhem_humidity_percent;{"location": "Terrasse","topic": "fhem/Terrasse/TermPearl02/humidity"};21;2;True
fhem/Garten/TermFetanten01/humidity;79;fhem_humidity_percent;{"location": "Garten","topic": "fhem/Garten/TermFetanten01/humidity"};79;2;True
fhem/Garten/rainmeter01/rain_total;134.8;fhem_rain_mm;{"location":"Garten","topic": "fhem/Garten/rainmeter01/rain_total"};134.8;4;True
fhem/Terrasse/TermPearl02/temperature;22;fhem_temperature_celsius;{"location": "Terrasse","topic": "fhem/Terrasse/TermPearl02/temperature"};22;5;True
fhem/Terrasse/TermPearl02/humidity;24.3;fhem_humidity_percent;{"location": "Terrasse","topic": "fhem/Terrasse/TermPearl02/humidity"};24.3;1;True
fhem/Garten/TermFetanten01/humidity;79;fhem_humidity_percent;{"location": "Garten","topic": "fhem/Garten/TermFetanten01/humidity"};79;2;True
fhem/Garten/rainmeter01/rain_total;11.1;fhem_rain_mm;{"location":"Garten","topic": "fhem/Garten/rainmeter01/rain_total"};145.9;3;True
fhem/Garten/rainmeter01/rain_total;10;fhem_rain_mm;{"location":"Garten","topic": "fhem/Garten/rainmeter01/rain_total"};155.9;5;True
network/vlan11/srv01.local/ping;2;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "5.0"};{"_count": 1, "_sum": 2, "_bucket": 1};2;True
network/vlan11/srv01.local/ping;4;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "5.0"};{"_count": 2, "_sum": 6, "_bucket": 2};6;True
network/vlan11/srv01.local/ping;7;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "10.0"};{"_count": 3, "_sum": 13, "_bucket": 3};1;True
network/vlan11/srv01.local/ping;0.4;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "0.5"};{"_count": 4, "_sum": 13.4, "_bucket": 1};4;True
network/vlan11/srv01.local/ping;20;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "+Inf"};{"_count": 5, "_sum": 33.4, "_bucket": 5};5;True
network/vlan11/srv01.local/ping;11.1;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "+Inf"};{"_count": 6, "_sum": 44.5, "_bucket": 6};2;True
network/vlan11/srv01.local/ping;5;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "5.0"};{"_count": 7, "_sum": 49.5, "_bucket": 4};4;True
network/vlan11/srv01.local/ping;6;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "10.0"};{"_count": 8, "_sum": 55.5, "_bucket": 6};1;True
network/vlan11/srv01.local/ping;0.05;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "0.5"};{"_count": 9, "_sum": 55.55, "_bucket": 2};4;True
network/vlan11/srv01.local/ping;30;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "+Inf"};{"_count": 10, "_sum": 85.55, "_bucket": 10};5;True
ftp/update.bin/transferred;123;ftp_transferred_bytes;{"file": "update.bin","topic": "ftp/update.bin/transferred"};{"_count": 1, "_sum": 123};1;True
ftp/update.bin/transferred;234;ftp_transferred_bytes;{"file": "update.bin","topic": "ftp/update.bin/transferred"};{"_count": 2, "_sum": 357};1;True
ftp/update.bin/transferred;34;ftp_transferred_bytes;{"file": "update.bin","topic": "ftp/update.bin/transferred"};{"_count": 3, "_sum": 391};1;True
ftp/update.bin/transferred;45;ftp_transferred_bytes;{"file": "update.bin","topic": "ftp/update.bin/transferred"};{"_count": 4, "_sum": 436};1;True
ftp/update.bin/transferred;89;ftp_transferred_bytes;{"file": "update.bin","topic": "ftp/update.bin/transferred"};{"_count": 5, "_sum": 525};1;True
ftp/update.bin/transferred;11111;ftp_transferred_bytes;{"file": "update.bin","topic": "ftp/update.bin/transferred"};{"_count": 6, "_sum": 11636};1;True
Can't render this file because it contains an unexpected character in line 2 and column 68.

View File

@@ -0,0 +1,99 @@
# Config file for MQTT prometheus exporter
# Metric definitions
metrics:
# - name: 'mqtt_broker'
# help: 'System events from broker'
# type: 'gauge'
# topic: '$SYS/broker/#'
# label_configs:
# - source_labels: ['__msg_topic__']
# target_label: '__topic__'
# - source_labels: ['__value__']
# regex: '^(\d+([,.]\d*)?)$|^([,.]\d+)$'
# action: 'keep'
- name: 'mqtt_broker_version'
help: 'Mosquitto version (static)'
type: 'gauge'
topic: '$SYS/broker/version'
label_configs:
- source_labels: ['__msg_topic__']
target_label: '__topic__'
- source_labels: ['__value__']
regex: '^\D+((?:\d+[\.]?)+)$'
target_label: 'version'
replacement: '\1'
action: 'replace'
- source_labels: ['__value__']
replacement: '1'
target_label: '__value__'
action: 'replace'
- name: 'mqtt_broker_changeset'
help: 'Mosquitto build changeset (static)'
type: 'gauge'
topic: '$SYS/broker/changeset'
label_configs:
- source_labels: ['__msg_topic__']
target_label: '__topic__'
- source_labels: ['__value__']
target_label: 'changeset'
action: 'replace'
- source_labels: ['__value__']
replacement: '1'
target_label: '__value__'
action: 'replace'
- name: 'mqtt_broker_timestamp'
help: 'Mosquitto build timestamp (static)'
type: 'gauge'
topic: '$SYS/broker/timestamp'
label_configs:
- source_labels: ['__msg_topic__']
target_label: '__topic__'
- source_labels: ['__value__']
target_label: 'timestamp'
action: 'replace'
- source_labels: ['__value__']
replacement: '1'
target_label: '__value__'
action: 'replace'
- name: "fhem_temperature_celsius"
help: "443 Mhz Sensors, Temperature in C"
type: "gauge"
topic: "fhem/+/+/temperature"
label_configs:
- source_labels: ['__msg_topic__']
target_label: '__topic__'
- source_labels: ["__msg_topic__"]
regex: "fhem/([^/]+).*"
target_label: "location"
replacement: '\1'
action: "replace"
- name: "fhem_humidity_percent"
help: "443 Mhz Sensors, Humidity in %"
type: "gauge"
topic: "fhem/+/+/humidity"
label_configs:
- source_labels: ['__msg_topic__']
target_label: '__topic__'
- source_labels: ["__msg_topic__"]
regex: "fhem/([^/]+).*"
target_label: "location"
replacement: '\1'
action: "replace"
- name: "fhem_rain_mm"
help: "443 Mhz Sensors, rain in mm/m2"
type: "counter"
topic: "fhem/+/+/rain_total"
label_configs:
- source_labels: ['__msg_topic__']
target_label: '__topic__'
- source_labels: ["__msg_topic__"]
regex: "fhem/([^/]+).*"
target_label: "location"
replacement: '\1'
action: "replace"

View File

@@ -0,0 +1,15 @@
in_topic;in_payload;out_name;out_labels;out_value;delay;assert
$SYS/broker/version;' 2.0.11'; mqtt_broker_version; {"topic": "$SYS/broker/version", "version": "2.0.11"}; 1.0; 0; True
fhem/Terrasse/TerrasseWeiss/humidity; 20.0; fhem_humidity_percent; {"location": "Terrasse", "topic": "fhem/Terrasse/TerrasseWeiss/humidity"}; 20.0; 0; True
fhem/Terrasse/TermPearl02/temperature; 17.5; fhem_temperature_celsius; {"location": "Terrasse", "topic": "fhem/Terrasse/TermPearl02/temperature"}; 17.5; 0; True
fhem/Terrasse/TermPearl02/humidity; 20.0; fhem_humidity_percent; {"location": "Terrasse", "topic": "fhem/Terrasse/TermPearl02/humidity"}; 20.0; 0; True
fhem/Terrasse/TermPearl02/humidity; 21.0; fhem_humidity_percent; {"location": "Terrasse", "topic": "fhem/Terrasse/TermPearl02/humidity"}; 21.0; 0; True
fhem/Terrasse/TermPearl02/temperature; 17.6; fhem_temperature_celsius; {"location": "Terrasse", "topic": "fhem/Terrasse/TermPearl02/temperature"}; 17.6; 0; True
fhem/Garten/TermFetanten01/humidity; 66.0; fhem_humidity_percent; {"location": "Garten", "topic": "fhem/Garten/TermFetanten01/humidity"}; 66.0; 0; True
fhem/Terrasse/TermPearl02/temperature; 17.5; fhem_temperature_celsius; {"location": "Terrasse", "topic": "fhem/Terrasse/TermPearl02/temperature"}; 17.5; 0; True
$SYS/broker/version;' 2.0.11'; mqtt_broker_version; {"topic": "$SYS/broker/version", "version": "2.0.11"}; 1.0; 0; True
fhem/Garten/rainmeter01/rain_total; 106.426; fhem_rain_mm; {"location": "Garten", "topic": "fhem/Garten/rainmeter01/rain_total"}; {"_total": 106.426, "_created": 1628459492.695393}; 0; True
fhem/Garten/TermFetanten01/humidity; 65.0; fhem_humidity_percent; {"location": "Garten", "topic": "fhem/Garten/TermFetanten01/humidity"}; 65.0; 0; True
fhem/paz/TermPearl01/temperature; 24.3; fhem_temperature_celsius; {"location": "paz", "topic": "fhem/paz/TermPearl01/temperature"}; 24.3; 0; True
fhem/paz/TermPearl01/humidity; 17.0; fhem_humidity_percent; {"location": "paz", "topic": "fhem/paz/TermPearl01/humidity"}; 17.0; 0; True
fhem/Terrasse/TerrasseWeiss/humidity; 20.0; fhem_humidity_percent; {"location": "paz", "topic": "fhem/paz/TermPearl01/humidity"}; 17.0; 0; True
Can't render this file because it contains an unexpected character in line 2 and column 54.

View File

@@ -0,0 +1,22 @@
# Logging
logging:
# logfile: 'conf/mqttexperter.log' # Optional default '' (stdout)
level: 'debug' # Optional default 'info'
timescale: 0
# Metric definitions
metrics:
- name: "fhem_rain_mm"
help: "443 Mhz Sensors, rain in mm/m2"
type: "counter_absolute"
topic: "fhem/+/+/rain_total"
label_configs:
- source_labels: ['__msg_topic__']
target_label: '__topic__'
- source_labels: ["__msg_topic__"]
regex: "fhem/([^/]+).*"
target_label: "location"
replacement: '\1'
action: "replace"

View File

@@ -0,0 +1,13 @@
in_topic;in_payload;out_name;out_labels;out_value;delay;assert
fhem/Garten/rainmeter01/rain_total;4.8;fhem_rain_mm;{"location":"Garten","topic": "fhem/Garten/rainmeter01/rain_total"};4.8;4;True
fhem/Garten/rainmeter01/rain_total;11.1;fhem_rain_mm;{"location":"Garten","topic": "fhem/Garten/rainmeter01/rain_total"};11.1;3;True
fhem/Garten/rainmeter01/rain_total;110;fhem_rain_mm;{"location":"Garten","topic": "fhem/Garten/rainmeter01/rain_total"};110;5;True
fhem/Garten/rainmeter01/rain_total;134.8;fhem_rain_mm;{"location":"Garten","topic": "fhem/Garten/rainmeter01/rain_total"};134.8;4;True
fhem/Garten/rainmeter01/rain_total;211.1;fhem_rain_mm;{"location":"Garten","topic": "fhem/Garten/rainmeter01/rain_total"};211.1;3;True
fhem/Garten/rainmeter01/rain_total;155.9;fhem_rain_mm;{"location":"Garten","topic": "fhem/Garten/rainmeter01/rain_total"};155.9;5;True
fhem/Garten/rainmeter01/rain_total;2134.8;fhem_rain_mm;{"location":"Garten","topic": "fhem/Garten/rainmeter01/rain_total"};2134.8;4;True
fhem/Garten/rainmeter01/rain_total;11.1;fhem_rain_mm;{"location":"Garten","topic": "fhem/Garten/rainmeter01/rain_total"};11.1;3;True
fhem/Garten/rainmeter01/rain_total;155.9;fhem_rain_mm;{"location":"Garten","topic": "fhem/Garten/rainmeter01/rain_total"};155.9;5;True
fhem/Garten/rainmeter01/rain_total;23134.8;fhem_rain_mm;{"location":"Garten","topic": "fhem/Garten/rainmeter01/rain_total"};23134.8;4;True
fhem/Garten/rainmeter01/rain_total;1233123.123123123123;fhem_rain_mm;{"location":"Garten","topic": "fhem/Garten/rainmeter01/rain_total"};1233123.123123123123;3;True
fhem/Garten/rainmeter01/rain_total;1233123.123123123124;fhem_rain_mm;{"location":"Garten","topic": "fhem/Garten/rainmeter01/rain_total"};1233123.123123123124;5;True
Can't render this file because it contains an unexpected character in line 2 and column 54.

View File

@@ -0,0 +1,58 @@
# Logging
logging:
# logfile: 'conf/mqttexperter.log' # Optional default '' (stdout)
level: 'debug' # Optional default 'info'
timescale: 0
# Metric definitions
metrics:
- name: "fhem_light_state"
help: "Light state on/off"
type: "enum"
topic: "fhem/+/+/light"
parameters:
states:
- 'on'
- 'off'
label_configs:
- source_labels: ['__value__']
regex: "(ON|0)"
target_label: '__value__'
replacement: 'on'
action: "replace"
- source_labels: ['__value__']
regex: "(OFF|1)"
target_label: '__value__'
replacement: 'off'
action: "replace"
- source_labels: ['__msg_topic__']
target_label: '__topic__'
- source_labels: ["__msg_topic__"]
regex: "fhem/([^/]+).*"
target_label: "location"
replacement: '\1'
action: "replace"
- name: 'network_ping_ms'
help: 'ping response in ms'
type: 'histogram'
topic: 'network/+/+/ping'
parameters:
buckets:
- 0.5
- 5
- 10
label_configs:
- source_labels: ['__msg_topic__']
target_label: '__topic__'
- source_labels: ["__msg_topic__"]
regex: "network/([^/]+).*"
target_label: "network"
replacement: '\1'
action: "replace"
- source_labels: ["__msg_topic__"]
regex: "network/[^/]+/([^/]+).*"
target_label: "server"
replacement: '\1'
action: "replace"

View File

@@ -0,0 +1,23 @@
in_topic;in_payload;out_name;out_labels;out_value;delay;assert
fhem/room01/desk/light01;on;fhem_light_state;{"location":"Garten","topic": "fhem/room01/desk/light01"};0;4;True
fhem/room01/desk/light01;on;fhem_light_state;{"location":"Garten","topic": "fhem/room01/desk/light01"};0;3;True
fhem/room01/desk/light01;off;fhem_light_state;{"location":"Garten","topic": "fhem/room01/desk/light01"};1;5;True
fhem/room01/desk/light01;on;fhem_light_state;{"location":"Garten","topic": "fhem/room01/desk/light01"};0;4;True
fhem/room01/desk/light01;off;fhem_light_state;{"location":"Garten","topic": "fhem/room01/desk/light01"};1;3;True
fhem/room01/desk/light01;ON;fhem_light_state;{"location":"Garten","topic": "fhem/room01/desk/light01"};0;5;True
fhem/room01/desk/light01;OFF;fhem_light_state;{"location":"Garten","topic": "fhem/room01/desk/light01"};1;4;True
fhem/room01/desk/light01;off;fhem_light_state;{"location":"Garten","topic": "fhem/room01/desk/light01"};1;3;True
fhem/room01/desk/light01;1;fhem_light_state;{"location":"Garten","topic": "fhem/room01/desk/light01"};1;5;True
fhem/room01/desk/light01;0;fhem_light_state;{"location":"Garten","topic": "fhem/room01/desk/light01"};0;4;True
fhem/room01/desk/light01;on;fhem_light_state;{"location":"Garten","topic": "fhem/room01/desk/light01"};0;3;True
fhem/room01/desk/light01;off;fhem_light_state;{"location":"Garten","topic": "fhem/room01/desk/light01"};1;5;True
network/vlan11/srv01.local/ping;2;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "5.0"};{"_count": 1, "_sum": 2, "_bucket": 1};2;True
network/vlan11/srv01.local/ping;4;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "5.0"};{"_count": 2, "_sum": 6, "_bucket": 2};6;True
network/vlan11/srv01.local/ping;7;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "10.0"};{"_count": 3, "_sum": 13, "_bucket": 3};1;True
network/vlan11/srv01.local/ping;0.4;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "0.5"};{"_count": 4, "_sum": 13.4, "_bucket": 1};4;True
network/vlan11/srv01.local/ping;20;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "+Inf"};{"_count": 5, "_sum": 33.4, "_bucket": 5};5;True
network/vlan11/srv01.local/ping;11.1;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "+Inf"};{"_count": 6, "_sum": 44.5, "_bucket": 6};2;True
network/vlan11/srv01.local/ping;5;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "5.0"};{"_count": 7, "_sum": 49.5, "_bucket": 4};4;True
network/vlan11/srv01.local/ping;6;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "10.0"};{"_count": 8, "_sum": 55.5, "_bucket": 6};1;True
network/vlan11/srv01.local/ping;0.05;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "0.5"};{"_count": 9, "_sum": 55.55, "_bucket": 2};4;True
network/vlan11/srv01.local/ping;30;network_ping_ms;{"network": "vlan11","topic": "network/vlan11/srv01.local/ping", "server": "srv01.local", "le": "+Inf"};{"_count": 10, "_sum": 85.55, "_bucket": 10};5;True
Can't render this file because it contains an unexpected character in line 2 and column 47.