Unreliable InfluxDB size sensor

As soon as I use the init_commands, after restarting the addon I get constant and plenty of these:

Error: The connection was refused.
Connection error: Connection Refused: not authorised.
Error: The connection was refused.
Connection error: Connection Refused: not authorised.
Error: The connection was refused.
Connection error: Connection Refused: not authorised.
Error: The connection was refused.
Connection error: Connection Refused: not authorised.
Error: The connection was refused.
Connection error: Connection Refused: not authorised.
Error: The connection was refused.
Connection error: Connection Refused: not authorised.
Error: The connection was refused.
Connection error: Connection Refused: not authorised.
Error: The connection was refused.
Connection error: Connection Refused: not authorised.
Error: The connection was refused.
Connection error: Connection Refused: not authorised.

:arrow_right::question::question::question:

@sender I saw in Unreliable InfluxDB size sensor - #39 by sender you ran into the same issue. How did you fix this?

@erkr might have an idea too I guess.

UPDATE:
Found the error. I can strongly recommend to put and for MQTT in ', so make sure to use ...-u '<username>' -P '<password>'... :white_check_mark:


What would the SSH & Web Terminal addon insert need to look like if I want to to it other stuff too (by always also sending the output to MQTT)?

Like:

  • du for /data/influxdb/data/_internal (also in InfluxDB addon)
  • a simple du -shm /backup (for getting the size of the backup folder - not related to InfluxDB at all)?

Is this supposed to work?

while [ 1 = 1 ]; do du -shm /backup | cut -f1 | mosquitto_pub -t homeassistant/sensor/System/foldersize/backup -r -u <username> -P <password> -l && docker exec addon_a0d7b954_influxdb du -shm /data/influxdb/data/homeassistant | cut -f1 | mosquitto_pub -t homeassistant/sensor/InfluxDB/dbsize/homeassistant -r -u <username> -P <password> -l && docker exec addon_a0d7b954_influxdb du -shm /data/influxdb/data/_internal | cut -f1 | mosquitto_pub -t homeassistant/sensor/InfluxDB/dbsize/_internal -r -u <username> -P <password> -l && docker exec addon_a0d7b954_influxdb du -shm /data/influxdb/data/chronograf | cut -f1 | mosquitto_pub -t homeassistant/sensor/InfluxDB/dbsize/chronograf -r -u <username> -P <password> -l && sleep 900; done &

Because: not sure

  • if multiple commands are working
  • what the -l does

Update:
I managed to realize this too. It’s possible to set multiple init_commands (using the UI or the YAML editor). I decided to set 4 individual ones (3 for InfluxDB sizes and 1 for /backup (another use-case)). Will need to monitor system utilization but based on @tom_l 's intensive testing back then I guess it should be fine.