Skip to content
/ routEar Public

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

Notifications You must be signed in to change notification settings

m4hi2/routEar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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" 🤦‍♂️)

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages