Git Product home page Git Product logo

grafanaasusroutermonitor's Introduction

GrafanaAsusRouterMonitor

Monitor your Asus router with Grafana.

GrafanaAsusRouterMonitor This is what it looks like.

Compatibility

  1. Python >= 3.9
  2. Asus Merlin Firmware

HowTo

The DATA part, how to extract data from Asus router

Using asusMonitor.py to get all the data. It provides all the data shown in the picture above.

  1. I am using == Python 3.9.0 on Debian 9
  2. Install all the required python packages pip3 install -r ./requirements.txt
  3. 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 
  1. Run the python script python3 asusMonitor.py
  2. (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/, then systemctl daemon-reload, systemctl start asusMonitor.service.
  3. Log is redirected to /var/log/asusMonitor.log.

The DATABASE part, how to store the data

Using MySQL to store data. Percisely, I use MySQL docker for convenience.

  1. Install Docker.
  2. Modify the mysql part of docker-compose.yaml to meet your demand.
  3. docker-compose -f ./docker-compose.yaml up -d and MySQL in running as docker container.
  4. If you would like to install MySQL, I use mysql == 5.7.31 here to avoid problems in newer versions.
  5. Create a database named db_name.
mysql> CREATE DATABASE db_name;
  1. 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);

The VISUAL part, how to show the data

Using Grafana to show the data. Again, I use Grafana docker for convenience.

  1. Install docker.
  2. Modify the grafana part of docker-compose.yaml to meet your demand. More environment settings can be found on Grafana website.
  3. docker-compose -f ./docker-compose.yaml up -d and Grafana in running as docker container.
  4. Add MySQL as data source.
  5. I also put my Grafana config here(asusMonitor.json), it's exactly like the image above.

grafanaasusroutermonitor's People

Contributors

jphilll avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.