1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 14:16:00 +00:00

tasmota: simplify suggests caclulation

This commit is contained in:
Tim Connors 2024-09-28 21:07:03 +10:00
parent f1e354ebd3
commit 7bb5e2c0b1

View file

@ -16,9 +16,9 @@ ln -s /usr/share/munin/plugins/tasmota_ /etc/munin/plugins/tasmota_hostname_curr
Plugin also implements suggests, so if you have nodeattr installed and Plugin also implements suggests, so if you have nodeattr installed and
/etc/genders populated with "tasmota" as well as "powermon", /etc/genders populated with "tasmota" as well as "powermon",
"DS18B20","SCD40", "PMS5003" or "millivolts" flags for those tasmota "DS18B20", "temperature", "SCD40", "PMS5003" or "millivolts" flags for
devices that implement energy or temperature monitoring, you can run those tasmota devices that implement energy or temperature monitoring,
an ansible play like this to set up your links: you can run an ansible play like this to set up your links:
https://github.com/spacelama/ansible-initial-server-setup/tree/master/roles/monitoring/tasks https://github.com/spacelama/ansible-initial-server-setup/tree/master/roles/monitoring/tasks
=head1 APPLICABLE SYSTEMS =head1 APPLICABLE SYSTEMS
@ -84,38 +84,8 @@ if [ "$1" = "suggest" ]; then
echo "${device}_${i}" echo "${device}_${i}"
done done
done done
nodeattr -n '(tasmota || beken) && temperature' | while read -r device ; do for i in temperature DS18B20 SCD40 PMS5003 millivolts switch dimmer ; do
for i in temperature ; do nodeattr -n "(tasmota || beken) && $i" | while read -r device ; do
echo "${device}_${i}"
done
done
nodeattr -n '(tasmota || beken) && DS18B20' | while read -r device ; do
for i in DS18B20 ; do
echo "${device}_${i}"
done
done
nodeattr -n '(tasmota || beken) && SCD40' | while read -r device ; do
for i in SCD40 ; do
echo "${device}_${i}"
done
done
nodeattr -n '(tasmota || beken) && PMS5003' | while read -r device ; do
for i in PMS5003 ; do
echo "${device}_${i}"
done
done
nodeattr -n '(tasmota || beken) && millivolts' | while read -r device ; do
for i in millivolts ; do
echo "${device}_${i}"
done
done
nodeattr -n '(tasmota || beken) && switch' | while read -r device ; do
for i in switch ; do
echo "${device}_${i}"
done
done
nodeattr -n '(tasmota || beken) && dimmer' | while read -r device ; do
for i in dimmer ; do
echo "${device}_${i}" echo "${device}_${i}"
done done
done done