Monitor your Asus router with Grafana.
- Python >= 3.9
- Asus Merlin Firmware
Using asusMonitor.py
to get all the data. It provides all the data shown in the picture above.
- I am using == Python 3.9.0 on Debian 9
- Install all the required python packages
pip3 install -r ./requirements.txt
- Modify the basic information part of
asusMonitor.py
# Input basic information below..
## Your router's address (format: http://ip_address or https://ip_address)
asusAddr = '' # eg. http://192.168.1.1
## Your Asus router's management web page login user and password
asusUser = ''
asusPasswd = ''
## Your MySQL infomation (IP address, user, password, database, table)
sqlIP = '' # MySQL IP address, eg. 127.0.0.1
sqlPort = '3306' # Default port is 3306
sqlUser = '' # MySQL Username
sqlPasswd = '' # MySQL Password
sqlDb = '' # MySQL Database you're gonna use
sqlTable = '' # MySQL Table you're gonna use
- Run the python script
python3 asusMonitor.py
- (Optional) You can also run it as a system service, modify the
asusMonitor.service
and put it to/usr/lib/systemd/system/
or/usr/local/lib/systemd/system/
, thensystemctl daemon-reload
,systemctl start asusMonitor.service
. - Log is redirected to
/var/log/asusMonitor.log
.
Using MySQL to store data. Percisely, I use MySQL docker for convenience.
- Install Docker.
- Modify the mysql part of
docker-compose.yaml
to meet your demand. docker-compose -f ./docker-compose.yaml up -d
and MySQL in running as docker container.- If you would like to install MySQL, I use mysql == 5.7.31 here to avoid problems in newer versions.
- Create a database named
db_name
.
mysql> CREATE DATABASE db_name;
- Create a table named
table_name
with these columns in the database.
mysql> CREATE TABLE table_name (
internetRXSpeed FLOAT,
internetTXSpeed FLOAT,
wiredRXSpeed FLOAT,
wiredTXSpeed FLOAT,
wireless2gRXSpeed FLOAT,
wireless2gTXSpeed FLOAT,
wireless5gRXSpeed FLOAT,
wireless5gTXSpeed FLOAT,
coretemp2g INT,
coretemp5g INT,
coretempCPU INT,
cpu1Percentage FLOAT,
cpu2Percentage FLOAT,
ramUsage INT,
bandwidthRX FLOAT,
bandwidthTX FLOAT,
timeStamp TIMESTAMP NOT NULL PRIMARY KEY);
Using Grafana to show the data. Again, I use Grafana docker for convenience.
- Install docker.
- Modify the grafana part of
docker-compose.yaml
to meet your demand. More environment settings can be found on Grafana website. docker-compose -f ./docker-compose.yaml up -d
and Grafana in running as docker container.- Add MySQL as data source.
- I also put my Grafana config here(
asusMonitor.json
), it's exactly like the image above.