Influx/Grafana Help

Very newbie, how do I…

  1. use the command line to select the measurements after opening the database ?
  2. see the log (var/log/syslog) ?

Thanks

Take a look to this tutorial, my setup is base on it and is 100% functional.

It’s in German, but it’s quite visual to follow without understanding the language…

Br

For #2, try this: grep -i influx /var/log/syslog

That will pull out all the Influx entries in the syslog. You can also use nano or any other text editor to examine the syslog. You will always see some activity assuming InfluxDB is running. What you are looking for are http writes to the database.

For #1, see the InfluxDB documentation. This getting started guide is very good. Basically something like this:

> show databases (will show databases)
> use openhab_db (or whatever you named it)
> show measurements (should see your Item here in the list)
> select * from Temperature_GF_Living

You should see a list of values for your measurement with their timestamp. You may need to use the user/password when starting up if you set that up. This will use the default retention policy. I’m guessing you haven’t changed that.

If you see the measurements, then you know the data is getting written, and your issue is only with setting up Grafana. If you can’t see the measurements, then we need to figure out why they are not written out.

jswim,

So when for #2 I get this (Note I am now looking at Temperature_GF_Office (I see it comes up)

And for number #1 I get this but I cannot seem to go any further or I am entering in something wrong ?

image

In regards to #1 I figured it out. I had to enter (as you mentioned).
influx -username “user” - password “pass” to get it to work.

I can see that the only database in there is openhab_db but show measurements returns the following…

After some further research there seems to be a master user/pass, how would I find this and if I cannot how do I reset and start from scratch ?

Did you follow the instructions on this post originally? If so, that’s where you set the password for your database. Or did you follow some other guide? It seems like you didn’t grant the openhab user access to the openhab_db. Probably you did create an admin password?

$ influx
Connected to http://localhost:8086 version 0.13
InfluxDB shell version: 0.13
> CREATE DATABASE openhab_db
> CREATE USER admin WITH PASSWORD 'SuperSecretPassword123+' WITH ALL PRIVILEGES
> CREATE USER openhab WITH PASSWORD 'AnotherSuperbPassword456-'
> CREATE USER grafana WITH PASSWORD 'PleaseLetMeRead789?'
> GRANT ALL ON openhab_db TO openhab
> GRANT READ ON openhab_db TO grafana
> exit

In case you don’t remember what you did, you can stop influxdb, turn off authentication, start it up and enable it with a new password. See this for more information.

jswim,

I started from scratch (fresh SD install) and I am following the instructions (https://docs.influxdata.com/influxdb/v0.13/introduction/installation) however I get hung up here…

v

Joselh,

Thanks for the vid, this essentially follows the setup instructions as per the official doc’s however I am getting stuck as per last post below…?

These are for an old version (0.13). I suggest to follow these instructions for the current version.

The errors you get are caused by the fact that DISTRIB_ID and DISTRIB_CODEBASE are probably not defined as environment variables. You should give them a proper value for the distribution you want,

What do you mean by “You should give them a proper value for the distribution you want”, sorry newbie here

OK, sorry about that :innocent:
I just noticed that you are running Raspbian and looks like you where using the Ubuntu install instructions. The install commands should look like this,(because Raspbian is a distribution based on Debian):

wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add -
source /etc/os-release
echo "deb https://repos.influxdata.com/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

All,

I am currently stuck on this step as per the documentation

How & Where do I access this config file ?

Thanks to another post I figured out how to get access to the files via Filezilla, I now edited the files are per above however when I take the influxdb.conf file from my the PI to PC for editing via visual code studio and try to place it back Filezilla comes up with an error…

image

How can I get around this ?

Disregard please, I edited the file via sudo nano /etc/influxdb/influxdb.conf and the changes seemed to stick :slight_smile:

after following the install instructions it seems I am now stuck on Grafana (getting it to load)…

Any ideas ?

All did some more searching and got to this point, how do I resolve ?

image

and a few more issues, i seem to have issues on the startup with these commands

Log File below…

End result is I cannot log into grafana via IP:3000 (just stays at blank white screen)

Anybody ? :slight_smile:

Have you considered openHABian? It supports the RPI4 and can configure Influx and Grafana automatically for you. I don’t think it can fix what you have already; you’d probably have to start over and use it to install them along with OH.

1 Like

That’s what I thought I was using, do you have any “updated” examples on the process ?

If you are using openHABian, then you should be using the configuration tool, not manually installing InfluxDB and Grafana. See the optional components below.

You should use opehabian-config to get to this screen.

Going to load from scratch and record all my steps and will stop when something doesn’t work and advise. Stay tuned :slight_smile: .