InfluxDB+Grafana persistence and graphing

Tags: #<Tag:0x00007fe054e899c8> #<Tag:0x00007fe054e89888> #<Tag:0x00007fe054e896f8>

(Renan Muniz) #508

Hello everyone, I’m having trouble setting up the dynamic webview element with javascript. I have already changed the panelPath in the smarthome-grafana.js file, but it still continues to display the panelPath: “/dashboard-solo/db/” but in my grafana it is “/d-solo/WPd-KqmRz/”.
I appreciate who can help.

I was doing it the right way, just my browser that was caching the wrong url.

(Max Bec) #509

Is there a chance to automatically reload the sitemap, when I change a Switch.
For example if I change the From-Date.

At the moment I always have to press reload in the browser.

(Jonas) #510

Hi! I am a litte stuck at the setup … I created db and users like described and edited the infulxdb.conf with the "sudo nano /usr/local/etc/influxdb.conf on my mac to:

  # Determines whether HTTP endpoint is enabled.
   enabled = true

  # The bind address used by the HTTP service.
   bind-address = ":8086"

  # Determines whether user authentication is enabled over HTTP/HTTPS.
   auth-enabled = true

but after a restart when i send “influx” to the terminal it does not want a pw.
when i try it with:

influx -username admin -password SuperSecretPassword123+ -host localhost

(of course with my pw)
it works as well - but again: i don’t need to enter username and pw, just influx and it connects …

installed influx with brew and the only thing i did differently is the launch at startup. i pasted what brew told me to do to launch at startup (using brew services) and not what is written on the influx-page

(John Schmitz) #511

It connects and you can query the database? Or have you only tried connecting? At the command line you can get connected without specifying a password, but you shouldn’t be able to query the data without supplying an “auth” command. See

What InfluxDB version are you using?

(Christos) #512

I have the same issue

Version 1.5.2

(John Schmitz) #513

And you have an “admin” user? InfluxDB says it won’t enforce authentication unless there is an admin user.

InfluxDB was restarted? Anything interesting in the /var/log/syslog file?

(Jonas) #514

thanks for pointing me to that …
i could not use the db. but admin can so everything is working properly. i feel dumb now :wink:

(Immo Compas) #515

I’m using Grafana with MariaDB. So far, Grafana works ok, but I don’t get any graphs included in HABPanels.
I have frame defined and as URL:

But there is nothing displayed.
Also, as webview with a local web page, I can not get anything displayed.

<!DOCTYPE html>
        <meta http-equiv="Content-type" CONTENT="text/html; charset=utf-8">
        <link rel="stylesheet" type="text/css" href="charts.css" />

    <div class="container">
        <iframe src="" width="450" height="200" frameborder="0"></iframe>

Widget definition looks like this:

	<iframe style=" width: 100%;height: 500px; frameborder = 0" src="/static/chartLeistung.html" ></iframe>

(Kim Andersen) #516

I´m installing influxdb and Grafana on a Rpi3. I followed the tutorial, from message 84 installing influx and grafana on an Rpi3. I got no erros.
I came as far as the above step, (this quote). And I can not reach grafana using http://monitoring-host:3000.

But I´m confused wether I should continue to follow the instructions for grafana first, as mentioned above in this quote, or was it done when I installed it from message 84?

(Vincent Regaud) #517


replace monitoring-host with the IP where grafana is installed. eg:

(Kim Andersen) #518

Ohh I did. I end up with an timeout in chrome. Guess either Grafana isn´t running or something is wrong. I did start the service according to message 84, without any erros…

My worries is, wether I´m suppose to “Follow the installation instructions , to install Grafana on your monitoring-host .” , as mentioned in message 1, when I have done the installation according to message 84 (Rpi installation). I havn´t “Follow the installation instructions , to install Grafana on your monitoring-host .” , which might explain why I end up with an timeout. I just find it difficult, as I thought I was installing Grafana in Message 84.

(John Schmitz) #519

Message 84 describes installing both InfluxDB and Grafana. You should probably recheck each step in the Grafana installation section and make sure it gets installed without errors.

Note that Grafana is now supporting ARM directly with their new beta 5.2 release, but you may want to work with the known working version. Here’s the 5.2 beta:

(Kim Andersen) #520

These are the steps I followed from message 84 regarding Grafana: (I took a copy of the cli terminal).

[00:38:22] openhabian@openHABianPi:~$ echo "deb jessie main" | sudo tee /etc/apt/sources.list.d/grafana-fg2it.list
deb jessie main
[00:39:00] openhabian@openHABianPi:~$ sudo apt-key adv --keyserver --recv-keys 379CE192D401AB61
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.NI1N4lsw81 --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver --recv-keys 379CE192D401AB61
gpg: requesting key D401AB61 from hkp server
gpg: key D401AB61: public key "Bintray (by JFrog) <>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
[00:39:19] openhabian@openHABianPi:~$ sudo apt-get update && sudo apt-get install grafana
Hit jessie InRelease
Hit jessie InRelease
Hit jessie InRelease
Ign stable InRelease
Hit jessie InRelease
Get:1 jessie InRelease
Ign jessie InRelease
Hit stable Release.gpg
Get:2 stable InRelease
Ign stable InRelease
Hit stable Release
Get:3 jessie Release.gpg [821 B]
Hit jessie/main armhf Packages
Hit stable Release.gpg
Hit jessie/contrib armhf Packages
Get:4 jessie Release [5,298 B]
Hit jessie/main armhf Packages
Hit jessie/main Sources
Hit stable Release
Hit jessie/non-free armhf Packages
Hit jessie/main armhf Packages
Hit jessie/ui armhf Packages
Hit jessie/rpi armhf Packages
Get:5 jessie/main Translation-en_US [162 B]
Hit jessie/stable armhf Packages
Hit stable/main armhf Packages
Get:6 jessie/stable Translation-en_US [151 B]
Get:7 jessie/stable Translation-en [151 B]
Get:8 jessie/main Translation-en [162 B]
Get:9 jessie/main armhf Packages [6,316 B]
Get:10 jessie/stable Translation-en_US.UTF-8 [151 B]
Get:11 jessie/stable Translation-en_US [151 B]
Get:12 jessie/stable Translation-en [151 B]
Get:13 jessie/main Translation-en_US
Get:14 jessie/main Translation-en
Get:15 jessie/main Translation-en_US.UTF-8 [162 B]
Get:16 jessie/main Translation-en_US.UTF-8
Get:17 jessie/main Translation-en_US [162 B]
Hit stable/main armhf Packages
Get:18 jessie/main Translation-en [162 B]
Get:19 stable/main Translation-en_US
Get:20 stable/main Translation-en
Get:21 stable/main Translation-en_US.UTF-8
Get:22 jessie/stable Translation-en_US.UTF-8 [151 B]
Get:23 jessie/stable Translation-en_US [151 B]
Get:24 jessie/main Translation-en_US
Get:25 jessie/stable Translation-en [151 B]
Get:26 jessie/main Translation-en
Get:27 jessie/main Translation-en_US.UTF-8
Get:28 stable/main Translation-en_US
Get:29 stable/main Translation-en
Get:30 jessie/stable Translation-en_US.UTF-8 [151 B]
Get:31 stable/main Translation-en_US.UTF-8
Get:32 jessie/stable Translation-en_US [151 B]
Get:33 jessie/stable Translation-en [151 B]
Get:34 jessie/main Translation-en_US.UTF-8 [162 B]
Get:35 jessie/main Translation-en_US
Get:36 jessie/main Translation-en_US [162 B]
Get:37 jessie/main Translation-en
Get:38 jessie/main Translation-en [162 B]
Get:39 jessie/main Translation-en_US.UTF-8
Get:40 stable/main Translation-en_US
Get:41 jessie/stable Translation-en_US.UTF-8 [151 B]
Get:42 stable/main Translation-en
Get:43 jessie/stable Translation-en_US [151 B]
Ign jessie/stable Translation-en_US
Get:44 jessie/stable Translation-en [151 B]
Ign jessie/stable Translation-en
Get:45 stable/main Translation-en_US.UTF-8
Get:46 jessie/main Translation-en_US
Get:47 jessie/main Translation-en
Get:48 jessie/main Translation-en_US.UTF-8
Get:49 jessie/stable Translation-en_US.UTF-8 [151 B]
Ign jessie/stable Translation-en_US.UTF-8
Get:50 stable/main Translation-en_US
Get:51 stable/main Translation-en
Get:52 jessie/main Translation-en_US.UTF-8 [162 B]
Get:53 jessie/main Translation-en_US [162 B]
Get:54 stable/main Translation-en_US.UTF-8
Get:55 jessie/main Translation-en [162 B]
Ign jessie/main Translation-en_US
Get:56 jessie/main Translation-en_US
Ign jessie/main Translation-en_US
Ign jessie/main Translation-en
Get:57 jessie/main Translation-en
Ign jessie/main Translation-en
Get:58 jessie/main Translation-en_US.UTF-8
Ign jessie/main Translation-en_US.UTF-8
Ign jessie/main Translation-en_US.UTF-8
Get:59 stable/main Translation-en_US
Ign stable/main Translation-en_US
Ign jessie/ui Translation-en_US
Get:60 stable/main Translation-en
Ign stable/main Translation-en
Get:61 jessie/main Translation-en_US.UTF-8 [162 B]
Get:62 jessie/main Translation-en_US [162 B]
Ign jessie/main Translation-en_US
Get:63 stable/main Translation-en_US.UTF-8
Get:64 jessie/main Translation-en [162 B]
Ign stable/main Translation-en_US.UTF-8
Ign jessie/main Translation-en
Ign jessie/ui Translation-en
Ign jessie/ui Translation-en_US.UTF-8
Get:65 jessie/main Translation-en_US.UTF-8 [162 B]
Ign jessie/main Translation-en_US.UTF-8
Ign stable/main Translation-en_US
Ign jessie/contrib Translation-en_US
Ign jessie/contrib Translation-en
Ign jessie/contrib Translation-en_US.UTF-8
Ign stable/main Translation-en
Ign jessie/main Translation-en_US
Ign jessie/main Translation-en
Ign jessie/main Translation-en_US.UTF-8
Ign jessie/non-free Translation-en_US
Ign jessie/non-free Translation-en
Ign stable/main Translation-en_US.UTF-8
Ign jessie/non-free Translation-en_US.UTF-8
Ign jessie/rpi Translation-en_US
Ign jessie/rpi Translation-en
Ign jessie/rpi Translation-en_US.UTF-8
Fetched 12.4 kB in 7s (1,670 B/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
Use 'apt-get autoremove' to remove it.
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 48.5 MB of archives.
After this operation, 131 MB of additional disk space will be used.
Get:1 jessie/main grafana armhf 5.1.3 [48.5 MB]
Fetched 48.5 MB in 12s (3,788 kB/s)
[master 2d90ed7] saving uncommitted changes in /etc prior to apt run
 Author: openhabian <openhabian@openHABianPi>
 3 files changed, 2 insertions(+)
 create mode 100644 apt/sources.list.d/grafana-fg2it.list
Selecting previously unselected package grafana.
(Reading database ... 43404 files and directories currently installed.)
Preparing to unpack .../grafana_5.1.3_armhf.deb ...
Unpacking grafana (5.1.3) ...
Processing triggers for systemd (215-17+deb8u7) ...
Setting up grafana (5.1.3) ...
Adding system user `grafana' (UID 111) ...
Adding new user `grafana' (UID 111) with group `grafana' ...
Not creating home directory `/usr/share/grafana'.
### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd
 sudo /bin/systemctl daemon-reload
 sudo /bin/systemctl enable grafana-server
### You can start grafana-server by executing
 sudo /bin/systemctl start grafana-server
Processing triggers for systemd (215-17+deb8u7) ...
[master 528cd84] committing changes in /etc after apt run
 Author: openhabian <openhabian@openHABianPi>
 19 files changed, 799 insertions(+)
 create mode 100644 default/grafana-server
 create mode 100644 grafana/grafana.ini
 create mode 100644 grafana/ldap.toml
 create mode 100644 grafana/provisioning/dashboards/sample.yaml
 create mode 100644 grafana/provisioning/datasources/sample.yaml
 create mode 100755 init.d/grafana-server
Updating FireMotD available updates count ...
[00:40:45] openhabian@openHABianPi:~$ sudo systemctl daemon-reload
[00:41:01] openhabian@openHABianPi:~$ sudo systemctl enable grafana-server.service
Synchronizing state for grafana-server.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d grafana-server defaults
Executing /usr/sbin/update-rc.d grafana-server enable
Created symlink from /etc/systemd/system/ to /usr/lib/systemd/system/grafana-server.service.
[00:41:11] openhabian@openHABianPi:~$ sudo systemctl start grafana-server.service

To me, this looks like Grafana is started.
But I get an timeout when i try: (IP of my Rpi).

Damit, ignore the above. Grafana is running just fine. Just me testing the wrong IP… Sorry for taking your time… Saw it as soon as I had written the above… IP is not 137, but 237… No wonder why I´d get an timeout :frowning:

(Udo Hartmann) #521

What’s the output of

systemctl status grafana-server.service


Ah. Problem solved already…

(Kim Andersen) #522

Sorry Udo… My mistake… Grafana is running… I made an typo mistake in chrome… Wrong IP :frowning:

(Kim Andersen) #523

Did you get your problem fixed?
I have the same problem. Image not showing in sitemap…
I think it might be due to user restrictions. If I put the url in the adress line of the browser, I´m beeing promted for user details.

Not really sure why.
This is what I would suspect allowed anonymous access to the link (from my grafana.ini)

#################################### Anonymous Auth ##########################
# enable anonymous access
enabled = true

(John Schmitz) #524

check your grafana.log - maybe you are seeing this issue and need to set the organization? Or the grafana.log will tell you something else is wrong.

(Kim Andersen) #525

Hmm, tried to set the organisation to Openhab… No go…

This is grafana.log

t=2018-06-16T17:09:58+0200 lvl=info msg="Stopped Alerting" logger=alerting.engine reason="context canceled"
t=2018-06-16T17:09:58+0200 lvl=info msg="Grafana shutdown completed." code=0
t=2018-06-16T17:09:58+0200 lvl=info msg="Starting Grafana" logger=server version=5.1.3 commit=0871432 compiled=2018-05-16T17:39:55+0200
t=2018-06-16T17:09:58+0200 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2018-06-16T17:09:58+0200 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini
t=2018-06-16T17:09:58+0200 lvl=info msg="Config overridden from command line" logger=settings arg=""
t=2018-06-16T17:09:58+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.logs=/var/log/grafana"
t=2018-06-16T17:09:58+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins"
t=2018-06-16T17:09:58+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.provisioning=/etc/grafana/provisioning"
t=2018-06-16T17:09:58+0200 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana
t=2018-06-16T17:09:58+0200 lvl=info msg="Path Data" logger=settings path=/var/lib/grafana
t=2018-06-16T17:09:58+0200 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana
t=2018-06-16T17:09:58+0200 lvl=info msg="Path Plugins" logger=settings path=/var/lib/grafana/plugins
t=2018-06-16T17:09:58+0200 lvl=info msg="Path Provisioning" logger=settings path=/etc/grafana/provisioning
t=2018-06-16T17:09:58+0200 lvl=info msg="App mode production" logger=settings
t=2018-06-16T17:09:58+0200 lvl=info msg="Writing PID file" logger=server path=/var/run/grafana/ pid=11812
t=2018-06-16T17:09:58+0200 lvl=info msg="Initializing DB" logger=sqlstore dbtype=sqlite3
t=2018-06-16T17:09:58+0200 lvl=info msg="Starting DB migration" logger=migrator
t=2018-06-16T17:09:58+0200 lvl=info msg="Executing migration" logger=migrator id="copy data account to org"
t=2018-06-16T17:09:58+0200 lvl=info msg="Skipping migration condition not fulfilled" logger=migrator id="copy data account to org"
t=2018-06-16T17:09:58+0200 lvl=info msg="Executing migration" logger=migrator id="copy data account_user to org_user"
t=2018-06-16T17:09:58+0200 lvl=info msg="Skipping migration condition not fulfilled" logger=migrator id="copy data account_user to org_user"
t=2018-06-16T17:09:58+0200 lvl=info msg="Starting plugin search" logger=plugins
t=2018-06-16T17:09:58+0200 lvl=info msg="Initializing Alerting" logger=alerting.engine
t=2018-06-16T17:09:58+0200 lvl=info msg="Initializing CleanUpService" logger=cleanup
t=2018-06-16T17:09:58+0200 lvl=info msg="Initializing Stream Manager"
t=2018-06-16T17:09:58+0200 lvl=info msg="Initializing HTTP Server" logger=http.server address= protocol=http subUrl= socket=
t=2018-06-16T17:11:19+0200 lvl=eror msg="Failed to get user with id" logger=context userId=1 error="User not found"
t=2018-06-16T17:11:19+0200 lvl=eror msg="Anonymous access organization error: 'openhab': Organization not found"
t=2018-06-16T17:11:19+0200 lvl=info msg="Request Completed" logger=context userId=0 orgId=0 uname= method=GET path=/api/annotations status=401 remote_addr= time_ms=22 size=26 r$

(John Schmitz) #526

Pretty clear that the organization is a problem, but I’m not an expert on this:

eror msg="Failed to get user with id" logger=context userId=1 error="User not found"
eror msg="Anonymous access organization error: 'openhab': Organization not found"

I think you may want to make the organization name in your Configuration/Preferences to match the organization you are using in the auth.anonymous section.

(Kim Andersen) #527

Tried, and still no go. At least I get no errors in the logfile, but BasicUI wont show the dashboard.