hdecarne-github / fritzbox-telegraf-plugin Goto Github PK
View Code? Open in Web Editor NEWTelegraf plugin to gather FRITZ!Box statistics
Home Page: https://hdecarne-github.github.io/fritzbox-telegraf-plugin/
License: MIT License
Telegraf plugin to gather FRITZ!Box statistics
Home Page: https://hdecarne-github.github.io/fritzbox-telegraf-plugin/
License: MIT License
Hello,
i hope i doenst annoy you that much, i swapped the rented 7590 for own 5590 fiber with gpon sfp modul. it can read some stats but not the meshlist anymore. and i didnt added the last repeater yet.
wan info for current down/up speed is reported, modelname, uptime aswell. i think the other stats are out of scope for this like sfp temperature and so on.
First of all, thanks for the plugin! I've tried it out and I'm getting the following line for 'fritzbox_wan':
> fritzbox_wan,fritz_device=fritz.box,fritz_service=WANCommonInterfaceConfig1,host=data downstream_current_max_speed=0i,layer1_downstream_max_bit_rate=220000i,layer1_upstream_max_bit_rate=44000i,total_bytes_received=1969755805i,total_bytes_sent=169378472i,upstream_current_max_speed=0i 1671793243132608784
> fritzbox_wan,fritz_device=fritz.box,fritz_service=WANCommonInterfaceConfig1,host=data downstream_current_max_speed=0i,layer1_downstream_max_bit_rate=220000i,layer1_upstream_max_bit_rate=44000i,total_bytes_received=2216879145i,total_bytes_sent=174911653i,upstream_current_max_speed=0i 1671793253127604960
> fritzbox_wan,fritz_device=fritz.box,fritz_service=WANCommonInterfaceConfig1,host=data downstream_current_max_speed=0i,layer1_downstream_max_bit_rate=220000i,layer1_upstream_max_bit_rate=44000i,total_bytes_received=2312427719i,total_bytes_sent=220732205i,upstream_current_max_speed=0i 1671793263194768472
> fritzbox_wan,fritz_device=fritz.box,fritz_service=WANCommonInterfaceConfig1,host=data downstream_current_max_speed=0i,layer1_downstream_max_bit_rate=220000i,layer1_upstream_max_bit_rate=44000i,total_bytes_received=2313947573i,total_bytes_sent=272809601i,upstream_current_max_speed=0i 1671793273122245195
> fritzbox_wan,fritz_device=fritz.box,fritz_service=WANCommonInterfaceConfig1,host=data downstream_current_max_speed=0i,layer1_downstream_max_bit_rate=220000i,layer1_upstream_max_bit_rate=44000i,total_bytes_received=2314556161i,total_bytes_sent=273023403i,upstream_current_max_speed=0i 1671793283123886546
While getting these lines from telegraf I was running a speed test, you can see it from the total_bytes_received
increasing and then total_bytes_sent
increasing (first download and then upload speed test).
However the *_current_max_speed
is always 0 somehow.
From some older monitoring script I know that my Fritz!Box 5530 returns values for WAN upload and WAN download current speed/rate. I am using the fritzconnection Python module to query them from str_transmission_rate[1]
(Download) and str_transmission_rate[0]
(Upload).
Any ideas what's wrong here? What can I do to help debug this?
hello,
dunno if it is to warm at my place or am stupid.
which kind of host i write down there? got 3 avm devices, 2 routers/one in mesh as a "repeater" and one fritzbox 1200 repeater.
Hi,
I am running telegraf in a docker container and install the fritzbox plugin via Dockerfile while building the container.
My problem, and I can reproduce it every time, is that after a container restart the fritzbox.conf has parsing errors.
To reporduce I do the following:
These are the logs I am referring to (I marked the stages from above):
2024-01-16T07:44:21Z I! Starting Telegraf 1.29.1 brought to you by InfluxData the makers of InfluxDB
2024-01-16T07:44:21Z I! Available plugins: 241 inputs, 9 aggregators, 30 processors, 24 parsers, 60 outputs, 6 secret-stores
2024-01-16T07:44:21Z I! Loaded inputs: execd mem
2024-01-16T07:44:21Z I! Loaded aggregators:
2024-01-16T07:44:21Z I! Loaded processors:
2024-01-16T07:44:21Z I! Loaded secretstores:
2024-01-16T07:44:21Z I! Loaded outputs: influxdb
2024-01-16T07:44:21Z I! Tags enabled: host=telegraf user=${USER}
2024-01-16T07:44:21Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"telegraf", Flush Interval:10s
2024-01-16T07:44:21Z I! [inputs.execd] Starting process: /usr/local/bin/telegraf/fritzbox-telegraf-plugin [-config /etc/telegraf/telegraf.d/fritzbox.conf -poll_interval 10s]--> 2. restarted with empte fritzbox.conf - this error es expectd
2024-01-16T07:44:21Z E! [inputs.execd] stderr: "Err: nothing to run"
2024-01-16T07:44:21Z E! [inputs.execd] Process /usr/local/bin/telegraf/fritzbox-telegraf-plugin exited: exit status 1
2024-01-16T07:44:21Z I! [inputs.execd] Restarting in 10s...
2024-01-16T07:44:31Z I! [inputs.execd] Starting process: /usr/local/bin/telegraf/fritzbox-telegraf-plugin [-config /etc/telegraf/telegraf.d/fritzbox.conf -poll_interval 10s]
2024-01-16T07:44:31Z E! [inputs.execd] stderr: "Err: nothing to run"
2024-01-16T07:44:31Z E! [inputs.execd] Process /usr/local/bin/telegraf/fritzbox-telegraf-plugin exited: exit status 1
2024-01-16T07:44:31Z I! [inputs.execd] Restarting in 10s...
2024-01-16T07:44:41Z I! [inputs.execd] Starting process: /usr/local/bin/telegraf/fritzbox-telegraf-plugin [-config /etc/telegraf/telegraf.d/fritzbox.conf -poll_interval 10s]
2024-01-16T07:44:41Z E! [inputs.execd] stderr: "Err: nothing to run"
2024-01-16T07:44:41Z E! [inputs.execd] Error in plugin: read |0: file already closed
2024-01-16T07:44:41Z E! [inputs.execd] Error in plugin: error reading stderr: read |0: file already closed
2024-01-16T07:44:41Z E! [inputs.execd] Process /usr/local/bin/telegraf/fritzbox-telegraf-plugin exited: exit status 1
2024-01-16T07:44:41Z I! [inputs.execd] Restarting in 10s...
2024-01-16T07:44:51Z I! [inputs.execd] Starting process: /usr/local/bin/telegraf/fritzbox-telegraf-plugin [-config /etc/telegraf/telegraf.d/fritzbox.conf -poll_interval 10s]
2024-01-16T07:44:51Z E! [inputs.execd] stderr: "Err: nothing to run"
2024-01-16T07:44:51Z E! [inputs.execd] Process /usr/local/bin/telegraf/fritzbox-telegraf-plugin exited: exit status 1
2024-01-16T07:44:51Z I! [inputs.execd] Restarting in 10s...
2024-01-16T07:45:01Z I! [inputs.execd] Starting process: /usr/local/bin/telegraf/fritzbox-telegraf-plugin [-config /etc/telegraf/telegraf.d/fritzbox.conf -poll_interval 10s]
2024-01-16T07:45:01Z E! [inputs.execd] stderr: "Err: nothing to run"
2024-01-16T07:45:01Z E! [inputs.execd] Process /usr/local/bin/telegraf/fritzbox-telegraf-plugin exited: exit status 1
2024-01-16T07:45:01Z I! [inputs.execd] Restarting in 10s...
2024-01-16T07:45:11Z I! [inputs.execd] Starting process: /usr/local/bin/telegraf/fritzbox-telegraf-plugin [-config /etc/telegraf/telegraf.d/fritzbox.conf -poll_interval 10s]
2024-01-16T07:45:11Z E! [inputs.execd] stderr: "Err: nothing to run"
2024-01-16T07:45:11Z E! [inputs.execd] Process /usr/local/bin/telegraf/fritzbox-telegraf-plugin exited: exit status 1
2024-01-16T07:45:11Z I! [inputs.execd] Restarting in 10s...
2024-01-16T07:45:21Z I! [inputs.execd] Starting process: /usr/local/bin/telegraf/fritzbox-telegraf-plugin [-config /etc/telegraf/telegraf.d/fritzbox.conf -poll_interval 10s]
2024-01-16T07:45:21Z E! [inputs.execd] stderr: "Err: nothing to run"
2024-01-16T07:45:21Z E! [inputs.execd] Process /usr/local/bin/telegraf/fritzbox-telegraf-plugin exited: exit status 1
2024-01-16T07:45:21Z I! [inputs.execd] Restarting in 10s...
2024-01-16T07:45:31Z I! [inputs.execd] Starting process: /usr/local/bin/telegraf/fritzbox-telegraf-plugin [-config /etc/telegraf/telegraf.d/fritzbox.conf -poll_interval 10s]
2024-01-16T07:45:31Z E! [inputs.execd] stderr: "Err: nothing to run"
2024-01-16T07:45:31Z E! [inputs.execd] Process /usr/local/bin/telegraf/fritzbox-telegraf-plugin exited: exit status 1
2024-01-16T07:45:31Z I! [inputs.execd] Restarting in 10s...
2024-01-16T07:45:41Z I! [inputs.execd] Starting process: /usr/local/bin/telegraf/fritzbox-telegraf-plugin [-config /etc/telegraf/telegraf.d/fritzbox.conf -poll_interval 10s]
2024-01-16T07:45:41Z E! [inputs.execd] stderr: "Err: nothing to run"
2024-01-16T07:45:41Z E! [inputs.execd] Process /usr/local/bin/telegraf/fritzbox-telegraf-plugin exited: exit status 1
2024-01-16T07:45:41Z I! [inputs.execd] Restarting in 10s...
2024-01-16T07:45:51Z I! [inputs.execd] Starting process: /usr/local/bin/telegraf/fritzbox-telegraf-plugin [-config /etc/telegraf/telegraf.d/fritzbox.conf -poll_interval 10s]
2024-01-16T07:45:51Z E! [inputs.execd] stderr: "Err: nothing to run"
2024-01-16T07:45:51Z E! [inputs.execd] Process /usr/local/bin/telegraf/fritzbox-telegraf-plugin exited: exit status 1
2024-01-16T07:45:51Z I! [inputs.execd] Restarting in 10s...
2024-01-16T07:46:01Z I! [inputs.execd] Starting process: /usr/local/bin/telegraf/fritzbox-telegraf-plugin [-config /etc/telegraf/telegraf.d/fritzbox.conf -poll_interval 10s]--> 4. telegraf read the fritzbox.conf and tries to reach out for the fritz.box host (the error is also expected due to DNS configuration
2024-01-16T07:46:11Z E! [inputs.execd] stderr: "2024/01/16 07:46:11 E! Error in plugin: Get "http://fritz.box:49000/tr64desc.xml\": dial tcp: lookup fritz.box on 127.0.0.11:53: no such host"
2024-01-16T07:46:21Z E! [inputs.execd] stderr: "2024/01/16 07:46:21 E! Error in plugin: Get "http://fritz.box:49000/tr64desc.xml\": dial tcp: lookup fritz.box on 127.0.0.11:53: no such host"
2024-01-16T07:46:31Z E! [inputs.execd] stderr: "2024/01/16 07:46:31 E! Error in plugin: Get "http://fritz.box:49000/tr64desc.xml\": dial tcp: lookup fritz.box on 127.0.0.11:53: no such host"
2024-01-16T07:46:39Z E! [inputs.execd] Error in plugin: read |0: file already closed
2024-01-16T07:46:39Z I! [inputs.execd] Process /usr/local/bin/telegraf/fritzbox-telegraf-plugin shut down
2024-01-16T07:46:39Z I! [agent] Hang on, flushing any cached metrics before shutdown
2024-01-16T07:46:39Z I! [agent] Stopping running outputs
2024-01-16T07:46:42Z I! Loading config: /etc/telegraf/telegraf.conf
2024-01-16T07:46:42Z I! Loading config: /etc/telegraf/telegraf.d/fritzbox.conf--> 6. after restart of the container the fritzbox.conf has parsing errors
2024-01-16T07:46:42Z E! error loading config file /etc/telegraf/telegraf.d/fritzbox.conf: error parsing fritzbox, undefined but requested input: `fritzbox
To be complete with the configuration - this is my Dockerfile:
FROM telegraf:${TELEGRAF_VERSION}
RUN apt -y update && apt -y upgrade
RUN apt install -y unzip wget
RUN wget https://github.com/hdecarne-github/fritzbox-telegraf-plugin/releases/download/v0.4.0/fritzbox-linux-amd64-0.4.0.zip
RUN unzip fritzbox-linux-amd64-0.4.0.zip -d /usr/local/bin/telegraf/
and this is the part of the compose file used for the container:
#image: "telegraf:latest"
build:
context: telegraf/
args:
TELEGRAF_VERSION: latest
hostname: "telegraf"
container_name: telegraf
depends_on:
- influxdb
volumes:
- ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
- ./telegraf/telegraf.d/:/etc/telegraf/telegraf.d/
environment:
-USER: "telegraf"
-INFLUX_PASSWORD: "ChangeMe!!!"
networks:
- influx
On your screenshots, you used grafana to print your charts for the agregated data. Can you please share your grafana dashboard with us?
Hi all,
i try to run the arm64 plugin on:
ecb8049f37e7:/$ cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.18.4
PRETTY_NAME="Alpine Linux v3.18"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
ecb8049f37e7:/usr/share/grafana$ uname -a
Linux ecb8049f37e7 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 Linux
i get an error that cannot run the binary: Error in program file format...
$ file fritzbox-telegraf-plugin
fritzbox-telegraf-plugin: Mach-O 64-bit arm64 executable, flags:<|DYLDLINK|PIE>
(this is a docker container running on a PI4).
do i need to use an debian instead of alpine Linux ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.