henrywhitaker3 / Speedtest-Tracker

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

Add Influxdb Connection #515

Open MDHMatt opened 3 years ago

MDHMatt commented 3 years ago

Would be great if we could get a output to influxdb.

fenpaws commented 3 years ago

+1 i did something like this a while ago but your solutions seem way better. My newer try and my older one

henrywhitaker3 commented 3 years ago

Not merging the PR yet (need to write the wrapper for the influxdb version 2 client first), but have a look here. This the info you want in influx?

root9191 commented 3 years ago

How can i check if the Settings for InfluxDB are correct? I made Docker, the port is reachable - but there is no connection i think. Do i have to use another "driver" in the docker-compose.yml? Now i use the standard File from your Page.

henrywhitaker3 commented 3 years ago

I'll add a test connection button next time I work on this. To manually check this atm, you can get a shell in the container and run:

php /config/www/artisan tinker
App\Utils\InfluxDB\InfluxDB::connect()

If the output looks something like this:

>>> App\Utils\InfluxDB\InfluxDB::connect()
=> App\Utils\InfluxDB\InfluxDB {#3553}

Then the connection works, if it doesn't you should see an error in there

root9191 commented 3 years ago

Thank you for your Help! Unfortunately i do not have a connection to the DB. Can you show how you made it work?

henrywhitaker3 commented 3 years ago

Which version of influx are you using? I've only written the adapter for v1 so far

funnelcloudservices commented 3 years ago

My output is: App\Exceptions\InfluxDBNotEnabledException

Curiously, when I enable or disable the INflux integration in settings the pop-up windows always says "enabled or disabled heathchecks.io" section. I'm not sure if that's just an incorrect message or if the entire integration isn't enabled.

NigelVanHattum commented 3 years ago

Hey @funnelcloudservices,

Just started using speedtest, you have to disable Influx in the UI (The checkbox is enabled) and after that re-enable it. This got the connection working for me

srobert72 commented 2 years ago

Works with InfluxDb 1.8.10 I tried shell commands mentionned by @henrywhitaker3 Didn't work at first, but ok after some disabled/enabled as @NigelVanHattum said

root@09085a37bca5:/# php /config/www/artisan tinker
Psy Shell v0.10.6 (PHP 7.4.15 — cli) by Justin Hileman

>>> App\Utils\InfluxDB\InfluxDB::connect()
App\Exceptions\InfluxDBNotEnabledException

>>> App\Utils\InfluxDB\InfluxDB::connect()
App\Exceptions\InfluxDBNotEnabledException

>>> App\Utils\InfluxDB\InfluxDB::connect()
=> App\Utils\InfluxDB\InfluxDB {#3524}

>>> App\Utils\InfluxDB\InfluxDB::connect()
=> App\Utils\InfluxDB\InfluxDB {#3557}

>>> App\Utils\InfluxDB\InfluxDB::connect()
=> App\Utils\InfluxDB\InfluxDB {#3585}
ttenroK commented 2 years ago

It would be very nice if support for InfluxDB 2 would be added too. Is it planned?