Home Assistant Community Add-on: InfluxDB

I’ve considered adding telegraph, but that would actually require a whole different level of configuration and plugin support.

I’ve decided that that might be to much for now.

Hi,

Is it possible to install this on a different device that isn’t running my main hass.io? I have a spare RPi and would like to use this with Grafana installed on it to free up resources on my main Pi. Can we point to hass.io or does it need to be installed on the same device?

That is possible, you can mix and match.

Thanks got it up and running on separate pi in minutes thanks for your work on this and grafana.

:tada: Release v0.3.0

Full Changelog

Changed

  • Upgrades InfluxDB to v1.6.0
  • Upgrades Chronograf to v1.6.0
1 Like

Hi! Did you get to import historial cata on InfluxDB? I tested this script, but it didn’t work:

https://www.home-assistant.io/docs/tools/influxdb_import/

Thanks!

:tada: Release v1.0.0

The add-on has been running perfectly since its intial release, and is now STABLE!!! :tada:

We’ve updated InfluxDB and all the tools to the latest and greatest. This release adds password checks against the HaveIBeenPwned password database and now supports the use of your Home Assistant secrets file!

So you can now use !secret influxdb_password as your password and the add-on will fetch the actual password from your secrets file.

Full Changelog

Added

  • Enforces authentication and HaveIBeenPwned checks

Changed

  • Upgrades hadolint to latest
  • Upgrades base image to v2.1.0
  • Sets default Shell
  • Enables SSL by default
  • Upgrades apache2-utils to 2.4.29-1ubuntu4.1
  • Upgrades InfluxDB to v1.6.1
  • Upgrades Chronograf to v1.6.1
  • Upgrades Kapacitor to v1.5.1
  • Less aggressive cleanup
  • Stop NGinx from throwing log errors
  • Updates README and links
  • Marks add-on stable

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck

1 Like

:tada: Release v1.0.1

Full Changelog

Changed

  • Upgrades base image to v2.1.1

changelog: https://github.com/hassio-addons/addon-influxdb/compare/v1.0.0Full Changelog

Changed

  • Upgrades base image to v2.1.1

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck

1 Like

Upgraded and now get the following error:

Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp 127.0.0.1:8086: connect: connection refused
Please check your connection settings and ensure ‘influxd’ is running.

Is there an additional setting I need to set now?

There is nothing to worry about… This is the web interface complaining about the database not being ready yet.

It will retry until it is and continue working as normal.

Hi,
how can I export my metrics from influxdb running on hass.io? I want to migrate from pi to nuc and would like to take my data. How to access the influx cli?

Install influxdb on your own pc, and then you can access the cli using the -host parameter.

thanks for feedback. I’m able to connect to remote host (rpi). I’ve checked some influxdb docs, there seems no export function. Anybody knows a way to export the data?

This is actually not related to this add-on itself, but general InfluxDB. Anyway, try this: https://docs.influxdata.com/influxdb/v1.6/administration/backup_and_restore/

1 Like

here are some steps to import influxdb from hass.io addon to new influxdb:

  • get root access to resin.os, see here -> https://developers.home-assistant.io/docs/en/hassio_debugging.html
  • go inside influxdb container -> docker exec -it addon_XXXXXXXX_influxdb /bin/sh
  • run this command: influx_inspect export -datadir “/data/influxdb/data” -waldir “/data/influxdb/wal” -out “/data/file” -database homeassistant -retention autogen
  • -> adjust db name but keep -out dir
  • resin os has read-only filesystem, so you cannot copy file via docker cp
  • in hass.io, create new snapshot, the backup file will be in the snapshot tar file, extract it
  • optional: check file with editor, adjust db name
  • copy the file to the mounted volume of the new influxdb container or directly to the container
  • go inside influxdb container on new server
  • run this command: influx -import -path /var/lib/influxdb/file
  • you will see new database
2 Likes
  1. You should not mess in the Hassio Docker-containers
  2. This seems overly complicated, since there are better and easier options
  3. If you want to use docker commands anyway, the latest SSH & Web Terminal add-on can do that as well.

What’s wrong with the option in the url I send you? Didn’t it work?

  1. you are right
  2. didnt know about other options
  3. that’s new to me

I couldn’t figure out how to dump the whole database via cli and also got some permission problems.

Since the update I receive an error message. I tried to figure it out but haven’t succeed yet. The server is starting, in the add-on panel isn’t sopped, but the log reads…

Log
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
curl: error while loading shared libraries: /usr/lib/arm-linux-gnueabihf/libidn2.so.0: cannot read file data
ERROR: Something went wrong contacting the API
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 
curl: error while loading shared libraries: /usr/lib/arm-linux-gnueabihf/libidn2.so.0: cannot read file data
ERROR: Something went wrong contacting the API
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
curl: error while loading shared libraries: /usr/lib/arm-linux-gnueabihf/libidn2.so.0: cannot read file data
ERROR: Something went wrong contacting the HIBP API
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 11-nginx.sh: executing... 
[cont-init.d] 11-nginx.sh: exited 0.
[cont-init.d] 20-system-users.sh: executing... 
WARNING: Could not check password, assuming it is safe.
Adding password for user admin
Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp 127.0.0.1:8086: connect: connection refused
Please check your connection settings and ensure 'influxd' is running.
Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp 127.0.0.1:8086: connect: connection refused
Please check your connection settings and ensure 'influxd' is running.
Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp 127.0.0.1:8086: connect: connection refused
Please check your connection settings and ensure 'influxd' is running.
Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp 127.0.0.1:8086: connect: connection refused
Please check your connection settings and ensure 'influxd' is running.
Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp 127.0.0.1:8086: connect: connection refused
Please check your connection settings and ensure 'influxd' is running.
Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp 127.0.0.1:8086: connect: connection refused
Please check your connection settings and ensure 'influxd' is running.
pgrep: error while loading shared libraries: /usr/lib/arm-linux-gnueabihf/liblz4.so.1: invalid ELF header
[cont-init.d] 20-system-users.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing...

Edited: problem solved

Out of nowhere (without changing anything!) I started running into an issue last night – I can open Chronograf just fine, and it says it’s connected to InfluxDB at localhost:8086, but it’s showing as not having any databases. When I try to create a new one, I just get a 401: authorization failed error.

Checking the logs of the addon, I’m getting this

Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp 127.0.0.1:8086: connect: connection refused
Please check your connection settings and ensure 'influxd' is running.
[cont-init.d] 20-system-users.sh: exited 0.
[cont-init.d] 21-auth.sh: executing... 
/var/run/s6/etc/cont-init.d/20-system-users.sh: line 9:   641 Terminated              influxd
[cont-init.d] 21-auth.sh: exited 0.
[cont-init.d] 30-kapacitor.sh: executing... 
[cont-init.d] 30-kapacitor.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
INFO: Starting the InfluxDB
INFO: Starting Chronograf
time="2018-09-15T12:43:38-05:00" level=info msg="Serving chronograf at http://127.0.0.1:8889" component=server 
time="2018-09-15T12:43:38-05:00" level=info msg="Reporting usage stats" component=usage freq=24h reporting_addr="https://usage.influxdata.com" stats="os,arch,version,cluster_id,uptime" 
INFO: Starting the Kapacitor

Then, Kapacitor keeps restarting and spitting out this:

2018/09/15 12:38:32 Using configuration at: /etc/kapacitor/kapacitor.conf
ts=2018-09-15T12:38:32.196-05:00 lvl=error msg="encountered error" service=run err="open server: open service *influxdb.Service: failed to link subscription on startup: authorization failed"
run: open server: open service *influxdb.Service: failed to link subscription on startup: authorization failed

This just keeps happening for as long as the addon is running. I didn’t make any changes to anything, so I don’t know what happened.

1 Like