henrywhitaker3 / Speedtest-Tracker

Continuously track your internet speed
GNU General Public License v3.0
1.54k stars 121 forks source link

[Feature Request] Guide for using InfluxdbV2 with Speedtest-Tracker Avalible Now at Grafana Dashboard 16428 #996

Open masterwishx opened 2 years ago

masterwishx commented 2 years ago

Finaly uploaded my dashboard to Grafana with instructions Speedtest Tracker - InfluxDBv2 https://grafana.com/grafana/dashboards/16428

This dashboard shows data collected by Speedtest Tracker (https://github.com/henrywhitaker3/Speedtest-Tracker) and exported in an InfluxDBv1 database witch is connected to InfluxDBv2 bucket.

How to use it :

(InfluxDBv1 client connect to InfluxDBv2)

  1. create bucket in InfluxDBv2 2.1 create or use exist API token (ALL ACCESS) for create dbv1 and auth. 2.2 create API token (read/write) for this bucket to use with Grafana.

  2. Enter in Console of InfluxDBv2.

  3. Make DB:

influx v1 dbrp create -t yourtokenALLACCESS --bucket-id yourbucketid --db speedtest-tracker --rp v1-rp --default -o yourorg

  1. Make User:

influx v1 auth create -t yourtokenALLACCESS --username speedtest --password speedtestpass --write-bucket yourbucketid -o yourorg

  1. Config Client of InfluxDBv1(Speedtest-tracker) by entered data : db username, db pass , etc ...

  2. Check in InfluxDBv2 in Data Explorer that data is exist in bucket

  3. Then you can select all data needed and switch to Script Editor copy the script (already done)

  4. Configure Grafana to use with data from InfluxDBv2 ( select datasource = InfluxDB , Query Language = Flux ,Organization = yourorg , Bucket = speedtest , Token = yourtoken for bucket )

  5. import this script in Grafana Dashboard .

  6. Enjoy

Based on https://grafana.com/grafana/dashboards/16339

myspeedtest

Bronom commented 2 years ago

I've tried but i still got no data in db. I checked your picture and i followed you guide with exactly the same config except for my hostname (ip).

masterwishx commented 2 years ago

can you post more info on your setup from influxdb ang grafana ?

Bronom commented 2 years ago

I have influxdb on docker currently running with telegraf on windows and 2 exportarr on docker. I also have speedtest-tracker in docker who run everyday on 5AM. I would like to add your dashboard on my grafana, but my Speedtest tracker seems to not storing any data in influxdb 2. So i followed you guide by creating a new bucket called speedtest or with the same name for both bucket (speedtest-tracker)

Creating a new token with or without full access (for debuging).

Open the bash console for influxdb entering both commands with the info.

influx v1 dbrp create -t MYNEWTOKEN --bucket-id (speedtest-tracker bucket id) --db speedtest-tracker --rp v1-rp --default -o MYORGNAME

influx v1 auth create -t MYNEWTOKEN --username speedtest --password speedtestpass --write-bucket (speedtest-tracker bucket id) -o MYORGNAME

I also tried with my current user i currently use.

I entering my connection information in Speedtest-tracker influx cb enable : Checked http://(The ip of my server) port 8086 speedtest-tracker (i also tried with same db name for both and differents name) speedtest (or with my current user i use) speedtestpass (or with my current user password i use) and save

But now when i go in influxdb explorer i can't get any data its just empty

My grafana seems to connect successfully to influxdb but don't display data because my bucket looks empty.

EDIT: I tried with my current server and a VM and both don't work.

masterwishx commented 2 years ago

Befor grafana you should check if all data you created for speedtest is shown in influxdb data exploer.

For 'influx v1 dbrp create -t yourtoken' you need use Main token for ALL ACCCESS that allow to great db and auth , (i think token for buket dont allow to create db and auth) and the token you ctreat is for use in grafana for read write buket.

if you made all right you can check from console that db and auth is created , and if still no value from speedtest-tracker. try to disable and save then enable and save checkbox in speedtest. image

Bronom commented 2 years ago

I just did everything again and is still doesn't work. The db is still empty. I tried to disable enable the checkbox and no success

Bronom commented 2 years ago

I finally make it work. Im not sure how i did it but the last thing i tried was to remove the http:// before the host. I already tried it before but now it work.!

badummtss commented 1 year ago

I hope @masterwishx can help me out: I created everything and I get data in my bucket. But the Grafana Dashboard is showing nothing.

My Settings: Influx: Bucket = speedtest influx v1 db name = speedtest-tracker username = speedtest

Grafana: Name: speedtest-tracker QueryLang: Flux URL= Pointing to my Influx LXC (which works ) eg. http://influx:8086 Auth is Basic with credentials skipping tls Basic Auth Details: Username and Password I created eg. influx v1 auth create etc. Default Bucket: speedtest (not sure if I have to use my bucket name or the speedtest-tracker db?)

What I'm doing wrong here?

badummtss commented 1 year ago

solved I used your newer dashboard https://grafana.com/grafana/dashboards/16428 and everything is working fine

ric-m commented 1 month ago

The instructions refer to a V1 instance for both the DBRP and User as t steps 4 and 5:

    Make DB:
    influx v1 dbrp create -t yourtokenALLACCESS –bucket-id yourbucketid –db speedtest-tracker –rp v1-rp –default -o yourorg

    Make User:
    influx v1 auth create -t yourtokenALLACCESS –username speedtest –password speedtestpass –write-bucket yourbucketid -o yourorg

I've created a new instance of InfluxDB v2 in Docker. Configring the client speedtest-tracker in the "Influx DB" tab specifically refers to InfluxDB v2. I was expecting the confguration of Influxdb to be solely within the v2 environment.

Two questions:

Q1. Is the database and retention policy mappings for v1 the only way of getting data into InfluxDB v2 and on to Grafana or is there a more direct way? Q2. Is the –db speedtest-tracker argument just a convenient name and nothing more or does it have a special significance?

Next instruction

    Config client of InluxDBv1(Speedtest-tracker) by entered data: db username, db pass, etc...

However, the screen requires none of these things. Instead I get:

URL
Org
Bucket
Token

Q3. Is it just that the documentation has yet to catch up or am I attempting to configure the wrong version? I'm on App: 0.21.2.

Thanks, Ric

masterwishx commented 1 month ago

The instructions refer to a V1 instance for both the DBRP and User as t steps 4 and 5:

    Make DB:
    influx v1 dbrp create -t yourtokenALLACCESS –bucket-id yourbucketid –db speedtest-tracker –rp v1-rp –default -o yourorg

    Make User:
    influx v1 auth create -t yourtokenALLACCESS –username speedtest –password speedtestpass –write-bucket yourbucketid -o yourorg

I've created a new instance of InfluxDB v2 in Docker. Configring the client speedtest-tracker in the "Influx DB" tab specifically refers to InfluxDB v2. I was expecting the confguration of Influxdb to be solely within the v2 environment.

Two questions:

Q1. Is the database and retention policy mappings for v1 the only way of getting data into InfluxDB v2 and on to Grafana or is there a more direct way? Q2. Is the –db speedtest-tracker argument just a convenient name and nothing more or does it have a special significance?

Next instruction

    Config client of InluxDBv1(Speedtest-tracker) by entered data: db username, db pass, etc...

However, the screen requires none of these things. Instead I get:

URL
Org
Bucket
Token

Q3. Is it just that the documentation has yet to catch up or am I attempting to configure the wrong version? I'm on App: 0.21.2.

Thanks, Ric

This was my old config when used this old image docker of speedtest-tracker that works only with influxdbv1 so you was need to config influxdbv1 inside your influxdbv2 instance.

But then i moved to new https://github.com/alexjustesen/speedtest-tracker that have influxdbv2 native support and you can use my new dashboard https://grafana.com/grafana/dashboards/17808-speedtest-tracker-v2-influxdbv2/

ric-m commented 1 month ago

OK, thanks for that.

It was the comment "Same steps here as before for exporting data but without needs for influxDBv1." that threw me. I indeed try to repeat the same steps and in the process mangled my instance of influxdb.

But some of the steps are relevant, such as creating the token, organisation and bucket?

Do you have any info on what needs to be done, if anything, in influxdb v2 in addition to token, organisation and bucket?

Thanks for helping. Appreciated.

Ric

masterwishx commented 1 month ago

But some of the steps are relevant, such as creating the token, organisation and bucket

Yes these only you need for use influxdb2 with grafana and new speedtest-tracker.

masterwishx commented 1 month ago

OK, thanks for that.

It was the comment "Same steps here as before for exporting data but without needs for influxDBv1." that threw me. I indeed try to repeat the same steps and in the process mangled my instance of influxdb.

But some of the steps are relevant, such as creating the token, organisation and bucket?

Do you have any info on what needs to be done, if anything, in influxdb v2 in addition to token, organisation and bucket?

Thanks for helping. Appreciated.

Ric

Updated readme, for easy steps https://github.com/masterwishx/Speedtest-Tracker-v2-InfluxDBv2