Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
cd8b71e
Merge pull request #13 from RenWal/master
ma4nn Oct 6, 2021
2966bf9
run pylint check also for pull requests
ma4nn Oct 6, 2021
0b879fb
improved code styles
ma4nn Oct 6, 2021
4fe0603
added unit test for connection uptime module, fixed code styles for c…
ma4nn Oct 8, 2021
fec1417
added unit test for dsl module
ma4nn Oct 8, 2021
9fd7fb6
added unit test for ecostat module
ma4nn Oct 8, 2021
bc296ff
added unit test for energy module
ma4nn Oct 8, 2021
975dbf1
added unit test for traffic module
ma4nn Oct 8, 2021
bb5c247
made unit test suite work and moved all tests into subdirectory
ma4nn Oct 8, 2021
669e814
Merge branch 'RenWal:master' into master
ma4nn Jan 30, 2023
a29ddf4
Merge pull request #14 from RenWal/master
ma4nn Sep 28, 2023
432b03f
improved some code styles
ma4nn Sep 28, 2023
e5d4b20
Merge remote-tracking branch 'origin/master'
ma4nn Sep 28, 2023
280f5d7
switched to pytest for test suite (much easier parametrization), adap…
ma4nn Sep 28, 2023
b3dc545
renamed test base class to contain test_ prefix in order for pytest t…
ma4nn Sep 28, 2023
a068d17
renamed github action a bit
ma4nn Sep 28, 2023
f797a7e
renamed camelCased files according to pylint
ma4nn Sep 28, 2023
8fcd80c
minor refactorings
ma4nn Sep 28, 2023
cf204c2
fixed error in github action
ma4nn Sep 28, 2023
1222579
added timeout to requests, minor code improvements
ma4nn Sep 28, 2023
6c74cca
refactored tests to use pytest output assertions, default certificate…
ma4nn Sep 29, 2023
d5a34c8
fixed typo in github actions
ma4nn Sep 29, 2023
3b0b4cd
removed old python version 3.9 (added only for testing reasons) in gi…
ma4nn Sep 29, 2023
53cf590
Create dependabot.yml
ma4nn Sep 29, 2023
d2ec6f9
replaced test base class by using pytest conftest.py, raised pylint m…
ma4nn Sep 29, 2023
9a1a4ab
renamed file to better reflect its purpose
ma4nn Sep 29, 2023
4690216
Merge remote-tracking branch 'origin/master'
ma4nn Sep 29, 2023
eefffdc
renamed file to better reflect its purpose, used MagicMock instead of…
ma4nn Sep 29, 2023
7821e34
implemented munin interface class and unified print_* methods
ma4nn Sep 29, 2023
4032300
unified main_handler
ma4nn Sep 29, 2023
943e735
some minor refactorings and content updates
ma4nn Sep 29, 2023
9e5b3c6
Update fritzbox_file_session.py
wvogel Dec 11, 2023
e9aaef5
Update and rename fritzbox_smart_home_temperature.py to fritzbox_smar…
wvogel Dec 11, 2023
d76642f
Update README.md
wvogel Dec 11, 2023
94c88f2
made scripts compatible with Python 3.9 (this is the default in Raspb…
ma4nn Dec 12, 2023
5373b85
improved code style a bit
ma4nn Dec 13, 2023
77ed926
Merge pull request #17 from ma4nn/python39_compatibility
ma4nn Dec 13, 2023
015eb20
Merge branch 'master' into wvogel/master
ma4nn Dec 13, 2023
46d4998
minor code refactoring to remove pylint warnings
ma4nn Dec 13, 2023
970ef63
added unit tests for smart home plugin
ma4nn Dec 13, 2023
87ebca6
Merge branch 'add_unit_tests_for_smart_home' into wvogel/master
ma4nn Dec 13, 2023
49401bf
updated unit tests
ma4nn Dec 13, 2023
1d4ff22
used new FritzHomeAutomation object
ma4nn Dec 14, 2023
5784643
Merge pull request #18 from ma4nn/add_unit_tests_for_smart_home
ma4nn Dec 14, 2023
1d42cff
Merge branch 'wvogel/master' into refactor_link_saturation
ma4nn Dec 14, 2023
43fc243
refactored link saturation module
ma4nn Dec 14, 2023
3068f97
added 7530ax as fixture and supported fritzbox model, started refacto…
ma4nn Jun 2, 2024
0f99ff1
added python 3.12 to github action, disabled tls by default to avoid …
ma4nn Jun 2, 2024
dd4386a
updated deprecated github actions
ma4nn Jun 2, 2024
59ed1cf
updated deprecated github actions
ma4nn Jun 2, 2024
5cd097d
minor readme update
ma4nn Aug 31, 2024
d31ef14
updated readme to include latest fritzos update
ma4nn Oct 23, 2024
f05ec64
added factory methods to simplify handling with Fritz* classes
ma4nn Jul 31, 2025
55f1d22
added python 3.13
ma4nn Jul 31, 2025
bb10dc1
renamed docs subfolder
ma4nn Jan 1, 2026
41fdcba
updated github action to use up-to-date python versions
ma4nn Jan 1, 2026
7427f88
added more unit tests
ma4nn Jan 1, 2026
e84eafb
moved tests to separate directory
ma4nn Jan 2, 2026
e480457
made session handling more secure by setting correct file permissions
ma4nn Jan 2, 2026
9e3a03f
enable tls by default, switch to uv environments
ma4nn Jan 2, 2026
177418e
made fritzbox config init more robust
ma4nn Jan 2, 2026
676e073
implemented exclusive locks for the session files
ma4nn Jan 2, 2026
9c8ae38
switched github action also to uv tooling
ma4nn Jan 2, 2026
2d19e37
Bump certifi from 2025.11.12 to 2026.1.4
dependabot[bot] Jan 5, 2026
6f3e336
Bump urllib3 from 2.6.2 to 2.6.3
dependabot[bot] Jan 8, 2026
8396c20
switched github action also to uv tooling
ma4nn Jan 8, 2026
b4836e5
switched github action also to uv tooling
ma4nn Jan 8, 2026
99efacd
Bump fritzconnection from 1.15.0 to 1.15.1
dependabot[bot] Jan 30, 2026
4bc8dd7
Merge pull request #23 from ma4nn/dependabot/uv/fritzconnection-1.15.1
ma4nn Feb 1, 2026
bdf17e4
Merge pull request #21 from ma4nn/dependabot/pip/certifi-2026.1.4
ma4nn Feb 1, 2026
f2ceb5f
Merge pull request #22 from ma4nn/dependabot/pip/urllib3-2.6.3
ma4nn Feb 1, 2026
b90c1df
Bump certifi from 2026.1.4 to 2026.2.25
dependabot[bot] Feb 27, 2026
a62f63a
Merge pull request #24 from ma4nn/dependabot/uv/certifi-2026.2.25
ma4nn Mar 1, 2026
e08f2bb
Bump charset-normalizer from 3.4.4 to 3.4.5
dependabot[bot] Mar 6, 2026
0ae980a
Merge pull request #25 from ma4nn/dependabot/uv/charset-normalizer-3.4.5
ma4nn Mar 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "weekly"
allow:
- dependency-type: "direct"
23 changes: 0 additions & 23 deletions .github/workflows/pylint.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/verify-plugin-scripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Verify Plugin Scripts

on: [push,workflow_dispatch,pull_request]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13", "3.14" ]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install dependencies
run: |
uv sync --group dev
- name: Analysing the code with pylint
run: |
uv run pylint --errors-only $(find src/ -name "*.py" | xargs)
- name: Running tests
run: |
uv run pytest --cov
- name: Verify requirements.txt is up to date
if: ${{ matrix.python-version == '3.14' }} # Only check once, not for every Python version
run: |
uv pip compile pyproject.toml -o requirements-check.txt
diff -I "^#" requirements.txt requirements-check.txt || (echo "requirements.txt is out of date. Run: uv pip compile pyproject.toml -o requirements.txt" && exit 1)
- name: Archive production artifacts
if: ${{ matrix.python-version == '3.14' }} # @see https://devguide.python.org/versions/
uses: actions/upload-artifact@v6
with:
name: fritzbox-munin-plugins
path: src/fritzbox*.py
8 changes: 5 additions & 3 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
## fritzbox-munin-fast contributors
## fritzbox-munin-fast Contributors

Special thanks to all the people who had helped this project so far:

- Bob van de Vijver ([bobvandevijver](https://github.com/bobvandevijver))
- Framps ([framps](https://github.com/framps))
- Christian Stade-Schuldt
- Christian Stade-Schuldt ([Tafkas](https://github.com/Tafkas))
- Oliver Edelmann
- Rene Walendy ([RenWal](https://github.com/RenWal))
- Christoph Massmann ([christophmassmann](https://github.com/christophmassmann))
- Christoph Massmann ([ma4nn](https://github.com/ma4nn))
88 changes: 57 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,48 @@
# Munin Plugins for FritzBox
# Munin Plugins for FRITZ!Box

A collection of munin plugins to monitor your AVM FRITZ!Box router. The scripts have been developed using a FRITZ!Box 7590 running FRITZ!OS 7.50 and a FRITZ!WLAN Repeater 1750E running FRITZ!OS 7.27.
![build status](https://github.com/ma4nn/fritzbox-munin-fast/actions/workflows/verify-plugin-scripts.yml/badge.svg)

If you are using the scripts on a different FRITZ!Box model please let me know by
A collection of [Munin](https://munin-monitoring.org) plugins to monitor your [AVM FRITZ!Box](https://avm.de/produkte/fritzbox/) router.
The values are retrieved via the [fritzconnection](https://pypi.org/project/fritzconnection/) project (TR-064 interface).

So far the following FRITZ!Box models have been confirmed working:

- opening an issue
- submitting a pull request
| Model | Fritz!OS Version(s) |
|------------------|---------------------|
| FritzBox 7590 | 7.28 - 7.57 |
| FritzBox 7530 AX | 7.80 - 8.20 |

If you are using the scripts on a different FRITZ!Box model please let me know by

These python scripts are [Munin](http://munin-monitoring.org) plugins for monitoring the [FRITZ!Box](https://avm.de/produkte/fritzbox/) router by AVM.
- Opening an issue
- Submitting a pull request

## Purpose of this Fork

The scripts are build upon the original [fritzbox-munin](https://github.com/Tafkas/fritzbox-munin) with the goal to make use of the modern APIs that FRITZ!OS 7 provides.
These scripts are build upon the original [fritzbox-munin](https://github.com/Tafkas/fritzbox-munin) with the goal to make
use of the more modern APIs that Fritz!OS 7 provides.

The main differences to the original version are:
- Compatibility with latest FRITZ!OS version using username/password authentication
- No HTML Scraping is used
- All data is fetched either through the TR-064 interface or the JSON API
- Compatibility with latest Fritz!OS version using username/password authentication
- No HTML scraping
- All data is fetched through the TR-064 interface preferably (or the JSON API)
- Contrary to the original version this fork uses multigraphs: this removes the need to query the same API endpoint multiple times, all multigraph plugins have configuration options to switch individual graphs on and off
- Support for Smart Home devices, e.g. for measuring temperature
- Complete refactoring of the Python code base to make it more robust, use modern language features like type hinting and reuse identical code
- Add possibility to connect to FRITZ!Box via TLS
- Complete refactoring of the Python code base to make it more robust, use modern language features like type hinting, tests and remove code duplication
- Added possibility to connect to FRITZ!Box via TLS
- Added automated testing via GitHub Actions

## Requirements
- FRITZ!Box router with FRITZ!OS >= 07.50 (if you are on an older FRITZ!OS version, select an older version of fritzbox-munin-fast by browsing the tags in this repository)
- FRITZ!Box router with FRITZ!OS >= 7.50 (if you are on an older FRITZ!OS version, select an older version of fritzbox-munin-fast by browsing the tags in this repository)
- Munin 1.4.0 or later is required
- Python 3.x
- Python >= 3.9

## Available Plugins

### Connection Uptime
Plugin: `fritzbox_connection_uptime.py`
Shows the WAN connection uptime.
![Connection Uptime](doc/connection_uptime.png)
![Connection Uptime](docs/connection_uptime.png)

### DSL Errors
Plugin: `fritzbox_dsl.py`
Expand All @@ -50,9 +61,15 @@ Multigraph plugin, showing:
- CPU load
- CPU temperature

### Smart Home Temperature
Plugin: `fritzbox_smart_home_temperature.py`
![Smart Home Temperature](doc/smart_home_temperature.png)
### Smart Home
Plugin: `fritzbox_smart_home.py`
Multigraph plugin, showing:
- temperature sensors
- switch states
- power values
- energy consumption values

![Smart Home Temperature](docs/smart_home_temperature.png)

### Energy
Plugin: `fritzbox_energy.py`
Expand All @@ -77,38 +94,39 @@ Multigraph plugin, showing for 2.4GHz and 5GHz

## Installation & Configuration

1. Pre-requisites for the `fritzbox_traffic` and `fritzbox_connection_uptime` plugins are the [fritzconnection](https://pypi.python.org/pypi/fritzconnection) and [requests](https://pypi.python.org/pypi/requests) package. To install run
1. To install requirements run

pip install -r requirements.txt

1. Make sure the FRITZ!Box has UPnP status information enabled. (web interface: _Home Network > Network > Network Settings > Universal Plug & Play (UPnP)_)
1. Make sure the FRITZ!Box has UPnP status information enabled. (web interface: _Home Network Network Network Settings Universal Plug & Play (UPnP)_)

1. Copy all the scripts from `src/` folder to `/usr/share/munin/plugins`
1. Copy all the scripts from the [published release](https://github.com/ma4nn/fritzbox-munin-fast/releases) to `/usr/share/munin/plugins`

1. (optional) If you want to connect to FRITZ!Box using SSL, download the Fritz certificate (web interface: _Internet > Freigaben > FritzBox Dienste > Zertifikat > Zertifikat herunterladen_) and save it to `/etc/munin/box.cer`.
1. (optional) If you want to connect to FRITZ!Box using SSL, download the Fritz certificate (web interface: _Internet → Freigaben → FritzBox Dienste → Zertifikat → Zertifikat herunterladen_) and save it to `/etc/munin/box.cer`.
The certificate might change after a FRITZ!Box Update.

1. Create entry in `/etc/munin/plugin-conf.d/munin-node`:
1. Create entry in `/etc/munin/plugin-conf.d/fritzbox`:

[fritzbox_*]
env.fritzbox_password <fritzbox_password>
env.fritzbox_user <fritzbox_user>
env.fritzbox_password <fritzbox_password>
env.fritzbox_use_tls true
host_name fritzbox

See the plugin files for plugin-specific configuration options.

1. For each plugin you want to activate, create a symbolic link to `/etc/munin/plugins`, e.g.:
1. For each plugin you want to activate, create a symbolic link to `/etc/munin/plugins` and make it executable, e.g.:
```
ln -s fritzbox_dsl.py /etc/munin/plugins/fritzbox_dsl.py
ln -s fritzbox_dsl.py /etc/munin/plugins/fritzbox_dsl && chmod +x /etc/munin/plugins/fritzbox_dsl
```

1. Restart the munin-node daemon: `service munin-node restart`.

1. Done. You should now start to see the charts on the Munin pages!
1. Done. You should now start to see the charts on the Munin pages🥳

## Localization

The `fritzbox_energy` script depends on the language selected in your FRITZ!Box. Currently, two locales are
The `fritzbox_energy.py` script depends on the language selected in your FRITZ!Box. Currently, two locales are
supported:

1. German: `de` (default)
Expand All @@ -128,7 +146,6 @@ You can split the graphs of your FRITZ!Box from the localhost graphs by followin
address 127.0.0.1
use_node_name yes


[home.yourhost.net;fritzbox]
address 127.0.0.1
use_node_name no
Expand All @@ -137,7 +154,16 @@ You can split the graphs of your FRITZ!Box from the localhost graphs by followin

## Testing

To test a plugin use
### Manual Testing

To manually test a plugin use
```
munin-run --pidebug fritzbox_connection_uptime.py
```

### Unit Tests

Run all unit tests with
```
munin-run --debug fritzbox_connection_uptime.py
pytest --cov
```
File renamed without changes
File renamed without changes
3 changes: 2 additions & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ disable=raw-checker-failed,
suppressed-message,
useless-suppression,
deprecated-pragma,
use-symbolic-message-instead
use-symbolic-message-instead,
line-too-long

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
31 changes: 31 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[project]
name = "fritzbox-munin"
version = "12.0.0"
description = "A collection of Munin plugins to monitor your AVM FRITZ!Box router."
requires-python = ">=3.9"
dependencies = [
"fritzconnection>=1.12.0",
"lxml>=6.0.2",
"requests>=2.32.5",
]

[dependency-groups]
dev = [
"pylint>=3.3.9",
"pytest>=8.4.2",
"pytest-cov>=7.0.0",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]

[tool.coverage.run]
source = ["src"]
omit = ["tests/*"]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if __name__ == .__main__.:",
]
21 changes: 18 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
fritzconnection>=1.3.0
requests
lxml
# This file was autogenerated by uv via the following command:
# uv pip compile pyproject.toml -o requirements.txt
certifi==2026.2.25
# via requests
charset-normalizer==3.4.5
# via requests
fritzconnection==1.15.1
# via fritzbox-munin (pyproject.toml)
idna==3.11
# via requests
lxml==6.0.2
# via fritzbox-munin (pyproject.toml)
requests==2.32.5
# via
# fritzbox-munin (pyproject.toml)
# fritzconnection
urllib3==2.6.3
# via requests
26 changes: 0 additions & 26 deletions src/FritzboxConfig.py

This file was deleted.

47 changes: 0 additions & 47 deletions src/FritzboxFileSession.py

This file was deleted.

Loading