InfluxDB+Grafana persistence and graphing

influxdb
graphs
grafana
Tags: #<Tag:0x00007f0144e0c7b0> #<Tag:0x00007f0144e0c620> #<Tag:0x00007f0144e0c4b8>

(Yogi) #649

I already used htop to find which process cause this issue. It was grafana. I’m not sure if both CPU was on 100%, but it looks like it completely freeze whole openhab for a while. PaperUI and Habpanel wasn’t accesible during this peaks. When I removed graphs from Habpanel, CPU is fine and there is no peak for last week.

for habpanel I tried two aproaches

One was:
Rule:

rule "Store Graph Outside temp"
when
    Item Balcony_Temperature received update
then
    executeCommandLine("curl -L 'http://ip:3000/render/d-solo/v9xT1ZRgz/temoutside?panelId=2&orgId=1&tab=general&refresh=30m&width=500&height=250&tz=UTC%2B02%3A00' -o /etc/openhab2/html/grafana/graph_temp_outside.jpg", 5000)
end

Habpanel:

<object width="500" height="250" data="/static/grafana/graph_temp_outside.jpg" type="image/jpeg"></object>

And second one was access to graph right from the habpanel in object

Both with same result :confused:


(Rich Koshak) #650

Well, at this point I think you will need to go to a Grafana forum to get help. We use Grafana but none of us are experts here.


(Adtwomey) #651

Hi guys I about to go tho the steps that was posyed Sep “2016” I runing a Raspberry Ip with openhabian that runing openhab 2.4.

I use VS Coda also with doing some files

On do I just run tho the post in Sep “16” or is there an updated posted.


(Rich Koshak) #653

The original post was updated as improvements and other ideas were discovered so everything in the first post should be complete and up to date.


(Adtwomey) #654

ok time to start is it hard to do?


(Adtwomey) #657

I already useing port :3000 with an MQTT Broadlink Bridge


(Angelos) #658

so… either change the port on the bridge or change the default port of Grafana… :slight_smile:


(Adtwomey) #659

I trying MQTT but hoping I don’t stuff it up. Can’t find out how to do it with Grafana :frowning: that why I trying with MQTT 1st


(Adtwomey) #660

Fixed :smiley:


(Angelos) #661

http://docs.grafana.org/

Summary

obama


(Adtwomey) #662

thanks will check before asking sorry for posting but lol getting close to finshed in :smiley:


(Adtwomey) #663

Is @ThomDietrich saying I can skip

Because I did and now in data Source when adding openhab_db I get


InfluxDB Error: error authorizing query: create admin user first or disable authentication

(Adtwomey) #664

Ok fixed if you

auth-enabled = false         # will enforce authentication

If anyone as “not smart” like me


(Marino) #665

Hi! If anyone is in the need of processing large amounts of data from OH1 rrd to OH2 influx maybe can be interested in this: rrdToInflux
I was in the need today and just dodged some manual work with this
HTH


(Marcin J) #666

Has anyone problem with the recent update of android OpenHAB application?
Grafana in WebView returns error (after tap on exclamation mark):

Invalid dimensions for plot, width = 384, height = 0

In previous OpenHAB android app I saw grafana chart without problems.


(Angelos) #667

https://community.openhab.org/search?q=grafana%20category%3A18


(Holgi) #668

Hello,

I followed this nice tutorial to set up Influxdb and Grafana, but I get stuck while adding a datasource:

Openhab can write to the InfluxDB, according the service status:

● influxdb.service - InfluxDB is an open-source, distributed, time series database
   Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2018-11-19 22:59:38 CET; 10min ago
     Docs: https://docs.influxdata.com/influxdb/
 Main PID: 406 (influxd)
   CGroup: /system.slice/influxdb.service
           └─406 /usr/bin/influxd -config /etc/influxdb/influxdb.conf

Nov 19 23:05:24 openHABianPi influxd[406]: [httpd] 127.0.0.1 - openhab [19/Nov/2018:23:05:24 +0100] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.0" 36e449b3$
Nov 19 23:05:54 openHABianPi influxd[406]: [httpd] 127.0.0.1 - openhab [19/Nov/2018:23:05:54 +0100] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.0" 48b70f43$
Nov 19 23:06:24 openHABianPi influxd[406]: [httpd] 127.0.0.1 - openhab [19/Nov/2018:23:06:24 +0100] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.0" 5a98c234$
Nov 19 23:06:54 openHABianPi influxd[406]: [httpd] 127.0.0.1 - openhab [19/Nov/2018:23:06:54 +0100] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.0" 6c7a5eb2$
Nov 19 23:07:24 openHABianPi influxd[406]: [httpd] 127.0.0.1 - openhab [19/Nov/2018:23:07:24 +0100] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.0" 7e5b8809$
Nov 19 23:07:54 openHABianPi influxd[406]: [httpd] 127.0.0.1 - openhab [19/Nov/2018:23:07:54 +0100] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.0" 903d9099$
Nov 19 23:08:24 openHABianPi influxd[406]: [httpd] 127.0.0.1 - openhab [19/Nov/2018:23:08:24 +0100] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.0" a21f3831$
Nov 19 23:08:54 openHABianPi influxd[406]: [httpd] 127.0.0.1 - openhab [19/Nov/2018:23:08:54 +0100] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.0" b400dafa$
Nov 19 23:09:24 openHABianPi influxd[406]: [httpd] 127.0.0.1 - openhab [19/Nov/2018:23:09:24 +0100] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.0" c5e28e36$
Nov 19 23:09:54 openHABianPi influxd[406]: [httpd] 127.0.0.1 - openhab [19/Nov/2018:23:09:54 +0100] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&precision=n&rp=autogen&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.0" d7c42e49$

Excerpt from

/etc/influxdb/influxdb.conf

[http]
  # Determines whether HTTP endpoint is enabled.
   enabled = true

  # Determines whether the Flux query endpoint is enabled.
  # flux-enabled = false

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

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


My influxdb.cfg:

# The database URL, e.g. http://127.0.0.1:8086 or https://127.0.0.1:8084 .
# Defaults to: http://127.0.0.1:8086
url=http://127.0.0.1:8086

# The name of the database user, e.g. openhab.
# Defaults to: openhab
user=openhab

# The password of the database user.
password=supersecret

# The name of the database, e.g. openhab.
# Defaults to: openhab
db=openhab_db

# The retention policy to be used, needs to configured in InfluxDB
# Till v0.13: 'default', since v1.0: 'autogen'
retentionPolicy=autogen

Any idea why Grafana is not able to connect to the DB?


(Angelos) #669

change the Data Source type from Graphite to InfluxDB :slight_smile:


(Holgi) #670

@Dim

Shame on me, the only setting I did not transfer carefully.

I remember one of my profs saying “90% of all problems can be solved by looking carefully!”

He was right, thank you!


(Guillermo Schimmel) #671

Try this in grafana.ini

[auth.basic]
enabled = false