Very simple script to ping cloudflare every 5 seconds, to check and log if (and when) your network goes down
pythonping
(https://pypi.org/project/pythonping/)
time
datetime
Download / git clone the repo, install the requirements (should only be pythonping) and run via python3 main.py
Success: Pings Successful! | Time: 2022-03-15 16:33:40.721818 | Avg Ping: 9.79
Failure: Pings Failed! | Time: 2022-03-15 16:23:59.227668