GithubHelp home page GithubHelp logo

m4hi2 / routear Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 3.0 65 KB

Receives JSON data from router to notify the user (Through Desktop Notification) about various network information. The information can be sent via scripts from the router.

License: MIT License

Python 100.00%
networkingtool routeros flask-application toast-notifications

routear's Introduction

routEar

Receives JSON data from router to notify the user (Through Desktop Notification) about various network information. The information can be sent via scripts from the router.

Very basic network related automation tool. Basically written for people too lazy to refresh the web page to check if their network is back online or not after a connection dropout. Also, notifies when the internet goes down so no more guessing game if the router crashed or something else happened.

The fucntionality can be adapted to show any kind of network related diagnostic information sent from the router by changing the messages inside the code and/or creating more API endpoints. This can show port status and so on, limited by the necessity of the user.

OS Support

[✔] Windows 10

[✔] macOS

[✔] GNU/Linux

Usage

Get the code:

git clone https://github.com/m4hi2/routEar.git

Install pypoetry:

python3 -m pip install poetry

Install the required packages with:

poetry export -f requirements.txt > r.txt
pip install -r r.txt

or if you want to use it in a virtual env:

poetry install

Run the app with:

python -m routEar

Don't forget to click allow on the firewall prompt when prompted.

Using the exe file from release

I've created a windows binary using pyinstaller and it can be found under releases. This exe file can be directly ran by double clicking it or you can put it in your startup directory. Don't forget the icon file though 🤣

Setup/Scripting on the router side

Mikrotik

Mikrotik routers have a very handy feature called tools/netwatch that automatically pings given IP addresses and sends an interrupt based on the latency to the host. This information can be used to determined if there is internet connectivity or not. netwatch can also be used to trigger scripts based on host availability. Using this we can easily send a request to our flask webserver that's been running on our host machine.

Example:

Netwatch Up:

/tool fetch http-method=post http-data="{\"affected\":\"internet\",\"status\":\"up\"}" output=none url="http://X.X.X.X:8000/"  http-header-field="content-type: application/json"

Netwatch Down:

/tool fetch http-method=post http-data="{\"affected\":\"internet\",\"status\":\"down\"}" output=none url="http://X.X.X.X:8000/"  http-header-field="content-type: application/json"

Don't forget to change X.X.X.X with the IP of your desktop. Also, use static IP for the host.

OpenWRT

IDK man, don't have any OpenWrt box right now. Maybe some curl stuff? no clue. If you know, please write and send a pull request. Thank You !

Awesome Discord

Join Linux Bangladesh community at kill -9. The language of the server is : Bengali (BN_BD 😉) but I'm certain we understand English as well.

Credits

Project name credit goes to Aniruddha Adhikary (I initially named it, "windowsNetworkNotifier-withRouterScripts" 🤦‍♂️)

routear's People

Contributors

ahmubashshir avatar deepsourcebot avatar m4hi2 avatar oritromax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.