bb-Ricardo/fritzinfluxdb

Getting fritzinfluxdb to work with InfluxDBv2

netcruiser2k10 opened this issue · 7 comments

Hi

Im not sure if this is the correct place to put this help request but im having trouble getting it to work with InfluxDBv2.

Im currently using influxDBv1 atm and it works as it should with no errors, how ever i would like to upgrade the database program to V2.

To do this i have created a new virtual machine to do testing and ensure i know i works before changing my normal one. I have done a complete fresh install of the fritzconnection program and set it up the same way i did for the V1 database albeit stopping there and putting the API token in along with the organisation name and bucket name. when i come to start the program running it fails with this error

● fritzinfluxdb.service - Fritz to InfluxDB daemon
Loaded: loaded (/etc/systemd/system/fritzinfluxdb.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Tue 2023-01-31 23:58:15 GMT; 3s ago
Process: 876 ExecStart=/opt/fritzinfluxdb/.venv/bin/python /opt/fritzinfluxdb/fritzinfluxdb.py -d (>
Main PID: 876 (code=exited, status=1/FAILURE)
CPU: 281ms

Jan 31 23:58:15 influxdbv2test systemd[1]: fritzinfluxdb.service: Main process exited, code=exited, sta>
Jan 31 23:58:15 influxdbv2test systemd[1]: fritzinfluxdb.service: Failed with result 'exit-code'.

im stuck at this point on where to go from now. Any help would be appreciated as would like to Upgrade the database as i imagine support for V1 will be ending sometime in the future.

Where would i find the logs etc to try and look in to whats going wrong

Thanks In Advance

Hi,

first I would try to run it manually. Assuming you followed the installation instruction this should get you some more details:

cd /opt/fritzinfluxdb
. .venv/bin/activate
./fritzinfluxdb.py -v

What do you get if you run these commands?

Hey Ricardo

Thanks for getting back to me.

i have run the commands and it has come back with the following

2023-02-01 01:33:37,013 - INFO: Starting fritzinfluxdb v1.2.1 (2023-01-26)
2023-02-01 01:33:37,013 - INFO: Done reading config files
2023-02-01 01:33:37,014 - DEBUG: Config: influxdb.version = 1
2023-02-01 01:33:37,014 - DEBUG: Config: influxdb.hostname = http://192.168.178.30
2023-02-01 01:33:37,014 - DEBUG: Config: influxdb.port = 8086
2023-02-01 01:33:37,014 - DEBUG: Config: influxdb.tls_enabled = False
2023-02-01 01:33:37,014 - DEBUG: Config: influxdb.verify_tls = False
2023-02-01 01:33:37,014 - DEBUG: Config: influxdb.measurement_name = fritzbox
2023-02-01 01:33:37,014 - DEBUG: Config: influxdb.data_retention_days = 365
2023-02-01 01:33:37,014 - DEBUG: Config: influxdb.username =
2023-02-01 01:33:37,014 - DEBUG: Config: influxdb.password = ***
2023-02-01 01:33:37,014 - DEBUG: Config: influxdb.database =
2023-02-01 01:33:37,014 - DEBUG: Config: influxdb.token = PjG***
2023-02-01 01:33:37,014 - DEBUG: Config: influxdb.organisation = Home
2023-02-01 01:33:37,015 - DEBUG: Config: influxdb.bucket = new_test
2023-02-01 01:33:37,015 - ERROR: InfluxDB database not defined
2023-02-01 01:33:37,015 - DEBUG: Config: fritzbox.hostname = 192.168.178.1
2023-02-01 01:33:37,015 - DEBUG: Config: fritzbox.username = statistic
2023-02-01 01:33:37,015 - DEBUG: Config: fritzbox.password = ric***
2023-02-01 01:33:37,015 - DEBUG: Config: fritzbox.port = 49000
2023-02-01 01:33:37,015 - DEBUG: Config: fritzbox.tls_enabled = False
2023-02-01 01:33:37,015 - DEBUG: Config: fritzbox.verify_tls = False
2023-02-01 01:33:37,015 - DEBUG: Config: fritzbox.connect_timeout = 10
2023-02-01 01:33:37,015 - DEBUG: Config: fritzbox.request_interval = 10
2023-02-01 01:33:37,015 - DEBUG: Config: fritzbox.box_tag = fritz.box
2023-02-01 01:33:37,015 - DEBUG: Config: fritzbox.timezone = Europe/London

not sure why its saying theres a password in influxdb.password as that field is empty in the config file as that represents the information for influxdb V1

i have tried the host name with and without http and it doesnt work either

This is it without http in it

2023-02-01 01:37:57,980 - INFO: Starting fritzinfluxdb v1.2.1 (2023-01-26)
2023-02-01 01:37:57,981 - INFO: Done reading config files
2023-02-01 01:37:57,981 - DEBUG: Config: influxdb.version = 1
2023-02-01 01:37:57,981 - DEBUG: Config: influxdb.hostname = 192.168.178.30
2023-02-01 01:37:57,981 - DEBUG: Config: influxdb.port = 8086
2023-02-01 01:37:57,981 - DEBUG: Config: influxdb.tls_enabled = False
2023-02-01 01:37:57,981 - DEBUG: Config: influxdb.verify_tls = False
2023-02-01 01:37:57,982 - DEBUG: Config: influxdb.measurement_name = fritzbox
2023-02-01 01:37:57,982 - DEBUG: Config: influxdb.data_retention_days = 365
2023-02-01 01:37:57,982 - DEBUG: Config: influxdb.username =
2023-02-01 01:37:57,982 - DEBUG: Config: influxdb.password = ***
2023-02-01 01:37:57,982 - DEBUG: Config: influxdb.database =
2023-02-01 01:37:57,982 - DEBUG: Config: influxdb.token = PjG***
2023-02-01 01:37:57,982 - DEBUG: Config: influxdb.organisation = Home
2023-02-01 01:37:57,982 - DEBUG: Config: influxdb.bucket = new_test
2023-02-01 01:37:57,982 - ERROR: InfluxDB database not defined
2023-02-01 01:37:57,982 - DEBUG: Config: fritzbox.hostname = 192.168.178.1
2023-02-01 01:37:57,982 - DEBUG: Config: fritzbox.username = statistic
2023-02-01 01:37:57,982 - DEBUG: Config: fritzbox.password = ric***
2023-02-01 01:37:57,983 - DEBUG: Config: fritzbox.port = 49000
2023-02-01 01:37:57,983 - DEBUG: Config: fritzbox.tls_enabled = False
2023-02-01 01:37:57,983 - DEBUG: Config: fritzbox.verify_tls = False
2023-02-01 01:37:57,983 - DEBUG: Config: fritzbox.connect_timeout = 10
2023-02-01 01:37:57,983 - DEBUG: Config: fritzbox.request_interval = 10
2023-02-01 01:37:57,983 - DEBUG: Config: fritzbox.box_tag = fritz.box
2023-02-01 01:37:57,983 - DEBUG: Config: fritzbox.timezone = Europe/London

Hi,

The influxdb version in your config is set to 1. Try changing it to 2

i feel sooooo dumb now lol
its working i think as its streaming a load of verbose information on the page.

im gonna attempt to get grafana working on it now and will get back to you.

Thank you for pointing out the incorrect setting for the version of fritzconnection.

Both working perfectly from what i can see

Thanks for your help it is much appreciated :)

No worries. Hope everything works as expected.