TheCry / synology-fritzbox-grafana

influxDB, Grafana, collectd, FritzBox, snmp and telegraf
6 stars 3 forks source link

Connection Status N/A #2

Open Lexxior opened 2 years ago

Lexxior commented 2 years ago

I set everything up as described in the instructions

The Synology Dashboard works flawlessly I can access the Fritzbox Dashboard, but it looks like this

12

Any idea how to fix this?

TheCry commented 2 years ago

Did you add an user to the FritzBox for collecting datas and put the credentials to https://github.com/TheCry/synology-fritzbox-grafana/blob/main/collectd-fritzbox/fritzcollectd.conf This file must be uploaded to "fritzcollectd.conf" of your NAS. Which credentials has your FritzBox User?

Lexxior commented 2 years ago

Yes, I copied its content and replaced IP, username and password with my configuration The path to the file is entered correctly, I renamed the folder after the screenshot

grafik

TheCry commented 2 years ago

Ok.. Login with SSH to your NAS and switch to "root" with "sudo su -" and your password. Then run: docker exec -ti space2place-synology-fritzbox-grafana bash You will switch inside the docker container. Inside the container run: /etc/init.d/collectd status and tell me the status.

Lexxior commented 2 years ago

It says collectd is running.

TheCry commented 2 years ago

Exists the folder "collectd": ls -la /var/lib/influxdb/data/

Lexxior commented 2 years ago

It seems like it does not This is the output

ls -la /var/lib/influxdb/data/ total 16 drwxrwx--- 4 influxdb influxdb 4096 Dec 14 02:06 . drwxrwx--- 5 influxdb influxdb 4096 Dec 14 02:06 .. drwxrwx--- 4 influxdb influxdb 4096 Dec 14 02:06 _internal drwxrwx--- 4 influxdb influxdb 4096 Dec 14 02:06 telegraf

TheCry commented 2 years ago

As you see "collectd" is not working fine. Check the "/var/log/syslog" for errors. Run "tail -f /var/log/syslog" and restart the collectd daemon

Lexxior commented 2 years ago

This is the output

grafik

after the restart I get

grafik

TheCry commented 2 years ago

Take a look at the end of the conf file: /etc/collectd/collectd.conf Is there the following entry:

<Include "/etc/collectd/collectd.conf.d">
        Filter "*.conf"
</Include>
Lexxior commented 2 years ago

Yes, it is included in the file

TheCry commented 2 years ago

Mhh.. Very tricky.. Check whether the file exists: ls -la /usr/share/collectd/types.db

Open this file: vi /etc/influxdb/influxdb.conf

Search for the section "collectd"

[[collectd]]
enabled = true
bind-address = "127.0.0.1:25826"
database = "collectd"
typesdb = "/usr/share/collectd/types.db"

This is important. Otherwise the InfluxDB will not exist. Now check this: pip list The following packages must installed

fritzcollectd       0.7.0
fritzconnection     0.8.5
Lexxior commented 2 years ago

Everything exists and is exactly configured as you described

TheCry commented 2 years ago

That‘s very strange. Restart influxdb. Maybe one thing can be a problem. The password for the FritzBox user. The char „@„ in double quote can be a problem. Use please another char like „!“. Please show me the permissions of the user of that you added. And try to login through the FritzBox with the credentials.

Lexxior commented 2 years ago

I changed the password, still not working - I have no problem logging in with the user

grafik

Lexxior commented 2 years ago

I just deleted the dashboard and tried adding it again, now it says InfluxDB Error: database not found: collectd

Edit: I see there are 2 guys with the same error in issue #1 I have not upgraded the debian packages, as far as I know - however, I have watchtower running, maybe it upgraded something?

TheCry commented 2 years ago

Ich sehe gerade das Du deutsch sprichst.. :) Der Fehler den Du jetzt hast ist klar. Der kommt davon weil InfluxDB keine Datenbank von CollectD hat. Deswegen fragte ich nach der Ausgabe: ls -la /var/lib/influxdb/data/ Das bedeuted. Das CollectD nicht auf Deine FritzBox zugreift und keine Daten liefert. Und das verstehe ich gereade nicht. Unter /etc/grafana/provisioning/datasources muss eine Datei liegen: influxDB-FritzBox.yaml Diese ist für Grafana um die richtige Datasource einzubinden.

Zeige mir bitte mal von Docker den Inhalt von "Volumes".

Lexxior commented 2 years ago

Ja, ich spreche deutsch, but let's keep it in English in case somebody gets the same error - so they can use this as a guide :)

/etc/grafana/provisioning/datasources muss eine Datei liegen: influxDB-FritzBox.yaml

yes, this file exists

grafik

TheCry commented 2 years ago

Ok.. I will shutdown my instance and install the image again.

TheCry commented 2 years ago

I'd deleted my container and did a fresh installation of the image from Docker Hub. I can't reproduce the problem. Everything is working fine. But for me now. You install this image: https://hub.docker.com/r/space2place/synology-fritzbox-grafana And not: https://hub.docker.com/r/alhazmy13/telegraf-influxdb-grafana

Lexxior commented 2 years ago

I nuked the image and the container, redownloaded and it still does not work I don't know if I did something wrong I get this log in portainer when I start the container for the first time

/usr/lib/python3/dist-packages/supervisor/options.py:474: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.

self.warnings.warn(

2022-01-11 17:48:14,328 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.

2022-01-11 17:48:14,328 INFO Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing

2022-01-11 17:48:14,366 INFO RPC interface 'supervisor' initialized

2022-01-11 17:48:14,367 CRIT Server 'unix_http_server' running without any HTTP authentication checking

2022-01-11 17:48:14,367 INFO supervisord started with pid 14

2022-01-11 17:48:15,369 INFO spawned: 'sshd' with pid 15

2022-01-11 17:48:15,372 INFO spawned: 'influxdb' with pid 16

2022-01-11 17:48:15,373 INFO spawned: 'syslog' with pid 17

2022-01-11 17:48:15,375 INFO spawned: 'telegraf' with pid 18

2022-01-11 17:48:15,377 INFO spawned: 'collectd' with pid 19

2022-01-11 17:48:15,379 INFO spawned: 'grafana' with pid 20

2022-01-11 17:48:15,387 INFO spawned: 'chronograf' with pid 21

2022-01-11 17:48:15,390 INFO spawned: 'snmpwalk' with pid 22

2022-01-11 17:48:15,796 INFO exited: telegraf (exit status 0; not expected)

2022-01-11 17:48:16,166 INFO exited: collectd (exit status 0; not expected)

2022-01-11 17:48:16,386 INFO success: sshd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-01-11 17:48:16,387 INFO success: influxdb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-01-11 17:48:16,387 INFO success: syslog entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-01-11 17:48:16,387 INFO success: grafana entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-01-11 17:48:16,387 INFO success: chronograf entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

collectd[79]: plugin_load: plugin "syslog" successfully loaded.

collectd[79]: plugin_load: plugin "battery" successfully loaded.

collectd[79]: plugin_load: plugin "cpu" successfully loaded.

collectd[79]: plugin_load: plugin "df" successfully loaded.

collectd[79]: plugin_load: plugin "disk" successfully loaded.

collectd[79]: plugin_load: plugin "entropy" successfully loaded.

collectd[79]: plugin_load: plugin "interface" successfully loaded.

collectd[79]: plugin_load: plugin "irq" successfully loaded.

collectd[79]: plugin_load: plugin "load" successfully loaded.

collectd[79]: plugin_load: plugin "memory" successfully loaded.

collectd[79]: plugin_load: plugin "processes" successfully loaded.

2022-01-11 17:48:16,983 INFO spawned: 'telegraf' with pid 87

2022-01-11 17:48:16,984 INFO success: snmpwalk entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-01-11 17:48:17,460 INFO spawned: 'collectd' with pid 111

2022-01-11 17:48:17,461 INFO exited: grafana (exit status 0; expected)

2022-01-11 17:48:17,645 INFO exited: collectd (exit status 0; not expected)

2022-01-11 17:48:17,660 INFO exited: telegraf (exit status 0; not expected)

collectd[79]: plugin_load: plugin "rrdtool" successfully loaded.

collectd[79]: plugin_load: plugin "swap" successfully loaded.

collectd[79]: plugin_load: plugin "users" successfully loaded.

collectd[79]: utils_taskstats: CTRL_CMD_GETFAMILY("TASKSTATS"): No such file or directory

collectd[79]: utils_taskstats: get_family_id() = No such file or directory

collectd[79]: processes plugin: Creating taskstats handle failed.

collectd[79]: Initialization complete, entering read-loop.

collectd[79]: battery plugin: All available input methods failed.

collectd[79]: read-function of plugin `battery' failed. Will suspend it for 20.000 seconds.

2022-01-11 17:48:17,997 INFO exited: influxdb (exit status 0; expected)

2022-01-11 17:48:19,656 INFO spawned: 'collectd' with pid 128

2022-01-11 17:48:19,669 INFO spawned: 'telegraf' with pid 129

2022-01-11 17:48:19,758 INFO exited: collectd (exit status 0; not expected)

2022-01-11 17:48:19,833 INFO exited: telegraf (exit status 0; not expected)

2022-01-11 17:48:21,581 INFO exited: syslog (exit status 0; expected)

2022-01-11 17:48:21,581 INFO exited: snmpwalk (exit status 0; expected)

2022-01-11 17:48:23,584 INFO spawned: 'telegraf' with pid 148

2022-01-11 17:48:23,586 INFO spawned: 'collectd' with pid 149

2022-01-11 17:48:23,618 INFO exited: collectd (exit status 0; not expected)

2022-01-11 17:48:23,630 INFO gave up: collectd entered FATAL state, too many start retries too quickly

2022-01-11 17:48:23,630 INFO exited: telegraf (exit status 0; not expected)

2022-01-11 17:48:23,631 INFO gave up: telegraf entered FATAL state, too many start retries too quickly

TheCry commented 2 years ago

The problem with telegraf will be fixed. For now. Login to the container. Then do:

mkdir -p /etc/telegraf/.cache
chown telegraf:telegraf /etc/telegraf/.cache

Now kill an existing instance of telegraf ps -ef | grep telegraf Note the PID kill -9 PID Now you can start telegraf /etc/init.d/telegraf start and check it /etc/init.d/telegraf status

Lexxior commented 2 years ago

Alright, thanks Could this be the reason why it's not working?

2022-01-11 18:42:53,115 INFO gave up: collectd entered FATAL state, too many start retries too quickly

TheCry commented 2 years ago

Do the same with collectd ps -ef | grep collectd Note the PID kill -9 PID Now you can start collectd /etc/init.d/collectd start and check it /etc/init.d/collectd status

I'm not sure whether it is an issue to the missing collectd db. I'd the same error with telegraf in my log. But my instance is working.

I will try to fix the issue with telegraf and update the docker conatiner

Lexxior commented 2 years ago

Alright, thanks I don't know why my collectd db is missing, I did everything according to the instructions

Camelot631 commented 2 years ago

Hi Sascha... thanks for your message. Since I was absent, I missed something. I'll read along ... the installation doesn't work that way for me ... maybe someone has another idea ...

TheCry commented 2 years ago

One question. Do you have DSL or Fibre over LAN1?

Edit: I‘d found some important informations for the FritzBox and fritzcollectd

In order to be able to read the status information the option "Transmit status information over UPnP" has to be enabled in the "Network Settings" menu on the Fritz!BOX. For reading values that are marked with requires authentication in the introduction section, the option "Allow access for applications" (also in "Network Settings") has to be enabled as well. If desired a separate user account can be created for gathering statistics in "FRITZ!Box Users" in the "System" menu. The account needs to have the "FRITZ!Box Settings" permission.

Please check this in the FritzBox

dfoerster79 commented 2 years ago

i checked my installation and have the same outputs like lexxior. but i read in this instruction, the docker-collectd-fritzbox will only works till fritzos 7.28: https://github.com/rudelm/docker-collectd-fritzbox Screenshot 2022-01-11 210636

my fritzbox use 7.29... is this the problem?

TheCry commented 2 years ago

No- i‘ve 7.29 too. This is not the problem. Did you check what i‘ve quoted in my last comment?

dfoerster79 commented 2 years ago

One question. Do you have DSL or Fibre over LAN1?

Edit: I‘d found some important informations for the FritzBox and fritzcollectd

In order to be able to read the status information the option "Transmit status information over UPnP" has to be enabled in the "Network Settings" menu on the Fritz!BOX. For reading values that are marked with requires authentication in the introduction section, the option "Allow access for applications" (also in "Network Settings") has to be enabled as well. If desired a separate user account can be created for gathering statistics in "FRITZ!Box Users" in the "System" menu. The account needs to have the "FRITZ!Box Settings" permission.

Please check this in the FritzBox

i think it's allready ok fritz1 fritz2

dfoerster79 commented 2 years ago

i have dsl

TheCry commented 2 years ago

I'd created a new docker image with some new packages.

The problem with telegraf is fixed too. The message

INFO gave up: telegraf entered FATAL state, too many start retries too quickly

can be ignored. Telegraf is running. I'd installed the new image on my DS218+ with the latest version, and everything works.

Lexxior commented 2 years ago

I downloaded the image, created a new container and it still does not work - still can't find collectd database

Camelot631 commented 2 years ago

The same problem by me....

DS220+ and DS420+, Newest DSM-Version

TheCry commented 2 years ago

if someone will contact me (info@space2place.de) we can make a session over Teamviewer. Otherwise i'm not able to find the issue.

dfoerster79 commented 2 years ago

same Problem...

TheCry commented 2 years ago

Hello together.. Now I just tested everything with @dfoerster79. We have found the error. In the file "fritzcollectd.conf" had dfoerster79 at "Hostname" the entry: Fritz.Box Note the ".". This did not let "collectd" work properly. I can't say why, because I don't know exactly how "collectd" handles it. After the change to "FritzBox" (as it is given in the template), "collectd" delivered its data to InfluxDB.

Thanks again @dfoerster79 for the time you took to test this together with me.

Edit... Possibly a firewall (Synology Firewall) blocks as well. Log into the container and try to open port 49000 of your FritzBox with Telnet: telnet "IP address of the FritzBox" 49000

Telnet must be installed in the container before: apt update && apt install telnet

Lexxior commented 2 years ago

The file is correctly configured for me, tried the port and checked my Firewall where everything should be configured correctly yet the issue persists

TheCry commented 2 years ago

@Lexxior is ist possible to make a teamviever session? If yes send me an email. We will find a date. Remember i‘m in the timezone UTC +1

Lexxior commented 2 years ago

I sent you a mail

TheCry commented 2 years ago

@Lexxior thank you for the nice conversation. We were able to fix the error. It was due to the Influx database. It seems that the daemon started in a state that CollectD could not deliver any data. To fix the problem you have to log into the container: ps -ef | grep influx execute. Then stop the PID of the running process: kill -9 PID Then restart the database: /etc/init.d/influxdb start Now the command: /etc/init.d/influxdb status should give a positive output. @dfoerster79 I think that was also the problem with you. Not the point of "Fritz.Box".

@Camelot631 Please try this on your installation. I think it's the same problem

robokats commented 1 year ago

I have the exact same issue. I carefully read through this entire thread but did not find any suggestion that helps.

From the grafana interface I did a database test and got "InfluxDB Error: database not found: collectd".

Stopping and starting influxdb doesn't change anything.

TheCry commented 1 year ago

Check in the conatiner wheter collectd is running. Find the process id and kill the id. Then start collectd

robokats commented 1 year ago

I've killed collectd many times, it relaunches automatically. And it doesn't change a thing.

TheCry commented 1 year ago

Since upgrading the firmware to 7.56 i have the same problem. I have to check this