Skip to content

Sirorezka/wifi_monitoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How does it work

Monitor Wi-Fi connectivity by constant curl or ping requests to selected destinations. Monitor DNS servers for host resolving.

Designed and tested on macOs. Uses commands from terminal dig, curl, ping

Features

  • logs wi-fi network name;
  • Periodically do curl/ping requests to listed destination;
  • If destination is not reachable checks response from DNS using dig;
  • You can specify individual timeouts for each destination;
  • uses asyncio as backend to manage multiple simultaneous requests;

Installation

Designed and tested on macOs. Uses commands from terminal dig, curl, ping. Check that your user have necessary permissions to run this commands.

conda create --name python313 python=3.13
conda activate python313
pip install -r requirements.txt

How to run

  • modify settings in utils.py file
# default variables
CNT_PINGS = 2
CNT_CURLS = 1
TIMEOUT_S = 10 # cancel request that takes to long to response
SLEEP_S = 20 # sleep time between requests

...

DNS_SERVERS = [
    '8.8.8.8',
    '172.20.10.1',
]

REQUESTS = [
    Request.curl("google.com", sleep_s = 45),
    Request.curl("yandex.ru"),
    Request.curl("mail.ru",),
    Request.curl("github.com"),
    Request.curl("stackoverflow.com"),
    Request.curl("habr.com/ru/feed"),
    Request.curl("https://www.youtube.com/"),
    Request.curl("https://outline.mlrnd.ru/"),    
    Request.ping("127.0.0.1"), # loopback address    
]
  • run script with python:
python main.py

Reports

  • Example of saved logs:

image

  • Additionally you may run notebook "report.ipynb" and visualize outputs with failed requests: alt text

  • Also you may run notebook "report_dns.ipynb" and extract all records not resolved by DNS: alt text

About

Monitor Wi-Fi connectivity by constant curl or ping requests to selected destinations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors