2020-09-10 03:07:29 +02:00
# uplink - is not some program expecting uplinks to work!
2020-09-07 01:55:42 +02:00
2021-06-10 03:43:07 +02:00
**This README file is not up to date! It will be fixed soon to explain the installation and the usage of uplink.**
2020-09-10 23:06:58 +02:00
2020-09-10 03:07:29 +02:00
uplink is a tool to monitor the uplink status of AVM FRITZ!Box Cable and DSL based routers. It uses the TR-064 protocol over UPnP.
2020-09-07 01:55:42 +02:00
2020-09-07 04:17:00 +02:00
## Features
2020-10-05 03:23:29 +02:00
For now I can say that uplink can monitor the status of you FRITZ!Box uplinks. It can log to a file and writes results to a MariaDB/MySQL database. With some editing of the code you can you use SQLite too but this feature is not active at the moment. This will change in the future. I switched to MariaDB because I run uplink on a RaspberryPi and are evaluating results on my workstation. I am working on a Gtk+ frontend to generate statistics...
2020-09-07 04:17:00 +02:00
2020-09-07 01:55:42 +02:00
## Requirements
2020-09-10 21:39:26 +02:00
- Git (only for installing from Git repository)
2020-10-05 03:23:29 +02:00
- Python3 (running for me using 3.7.3 on Raspbian 10 and 3.8.5 on Arch Linux)
2020-09-10 03:07:29 +02:00
- fritzconnection >= 1.3.4
2020-09-10 21:39:26 +02:00
- pymysql >= 0.10.1
2020-09-10 03:07:29 +02:00
2020-10-05 03:23:29 +02:00
Just install the 3rd party dependencies using `pip install $PACKAGE` or your OS package manager
2020-09-07 01:55:42 +02:00
## Installation
git clone https://git.unixpeople.org/hanez/uplink.git
cd uplink
cp config.example.json config.json
### Configuration
Edit config.json to your needs.
#### Variables
- interval: The polling interval
- database: Path to sqlite3 Database
- uplinks: List of devices you want to poll
- provider: Custom name of the uplink provider
- ip: The IP of the router device
2020-09-07 06:16:24 +02:00
- password: The password of the router device
2020-09-07 01:55:42 +02:00
#### Example
{
2020-09-10 21:39:26 +02:00
"interval": 60,
"database_type": "mysql",
"database": "uplink",
"database_host": "127.0.0.1",
"database_user": "USER",
"database_password": "PASSWORD",
"cron": false,
"daemon": false,
2020-09-07 01:55:42 +02:00
"uplinks": [
{ "provider": "Cable Provider", "ip": "192.168.0.1", "password": "1234" },
{ "provider": "DSL Provider", "ip": "192.168.1.1", "password": "1234" }
]
}
2020-09-07 06:16:24 +02:00
2020-09-07 01:55:42 +02:00
### Create Database
sqlite3 uplink.sqlite3 < uplink.sql
## Usage
./uplink ./config.json
2020-09-07 06:16:24 +02:00
2020-09-07 01:55:42 +02:00
### Help
2020-09-07 02:19:38 +02:00
./uplink --help
## View collected data
2020-10-05 03:34:16 +02:00
I actually use "[DBeaver ](https://dbeaver.io/ )" for taking a look at the data uplink is collecting.
2020-09-07 02:19:38 +02:00
2020-10-05 03:44:13 +02:00
There will be a Gtk+ frontend to uplink at some time but this project is at a very early stage of development, so I want to write the collector first. Even support for other SQL databases is in planning in conjunction with the Gtk+ frontend. I use MariaDB only because I can move fast-forward.
2020-09-07 03:02:49 +02:00
2020-09-10 03:07:29 +02:00
## TODO (in no particular order)
2020-09-07 03:02:49 +02:00
- A lot... :)
2020-09-10 03:07:29 +02:00
- Make all config vars as ARGS and vice versa. ARGS have higher priority. Chain: default -> config -> ARGS.
2020-09-11 00:01:16 +02:00
- ~~Parallelize queries using threads to improve performance; Does not work using SQLite because of exclusive access to the database~~ **DONE **
- ~~SQL server backend; MariaDB/MySQL?~~ **DONE **
2020-09-10 23:06:58 +02:00
- Bring back SQLite support
- Switch to ORM (peewee?) to support PostgreSQL, MySQL and SQLite.
- Gtk+ frontend connecting to the database or loading a local copy of a SQLite file. wxGlade?
2020-09-11 00:01:16 +02:00
- ~~A cron mode to not let uplink run in an endless loop to be scheduled and executed by cron.~~ **DONE **
2020-09-10 03:07:29 +02:00
- A daemon mode to be a real UNIX daemon. For now, it's just sleep() based.
- Always keep platform independence in mind but not if uplink looses nice features on Linux.
2020-09-07 06:16:24 +02:00