Su - YOUR_USER -c "bash /home/pi/Scripts/net3. Unplug your cable or DSL modem, whatever, wait for. If ! then echo $(date) "offline" | tee -a $HOME/offline.csv fiįinally, if you want, you can add the following by doing sudo nano /etc/rc.local su - YOUR_USER -c "bash /home/pi/Scripts/net2.sh" & The first thing you should try with your internet connection is the same thing your ISP will tell you if you call them. ping 192.168.1.1 -n 1 > pingtest.txt Rem Search for unreachable in the file. cls :starting Rem Send one ping to the gateway. Rem Run batch file from an administrative command prompt. #!/bin/bashįor interface in $(ls /sys/class/net/ | grep -v lo)Äo if ] then OnLine=1 fi done The following batch file will do a quick test and reset for you: echo off Rem Microsoft Windows 10 ping test to gateway. I've modified it to suit your needs, but be aware that it may not work on all OS distributions. It is the right tool sot check the speed of WiFi, wireless, and mobile connection (3G, 4G LTE, 5G). Powered by Cloudflare's global edge network. Both Android and iOS users can try this app for download speed, upload speed, and ping of their internet connections. Check your network performance with our Internet speed test. Wget -q -tries=5 -timeout=20 -O - > /dev/nullÄ®lse echo $(date) "offline" | tee -a $HOME/offline.csvĪnother great answer, found, shows this script. Meteor is a simple and best internet speed test app that offers you easy-to-understand results. It was basically what I was looking for, finding the amount of times the internet connection went down. Note that its a better practice to call a script regularly from a cron than doing a loopÄ«ecause a comment containing a code snippet was hard to feed back into a file as valid syntax, I'm posting it as an answer here. To monitor internet connection stability, you need to check something called the âpingâ over an extended period of time. SPEED_TEST_RES=$(speedtest-cli -simple 2>/dev/null)ÄL=$(echo $SPEED_TEST_RES | awk ' After a decent chunk of time (an hour or so) go to the cmd window and hit ctrl-c. Open up your command line (windows+r, type 'cmd', hit ).LOG_FILE="/var/log/internet_test_$(hostname).csv" There are also web-based tools that rate your connection to several endpoints simultaneously. # */10 * * * * /location/of/my-internet-test.sh I personnaly have a script that stores reports of connection quality (depending on package speedtest you can get from apt-get install speedtest-cli #!/bin/bash Mail -s "Internet connection lost on $(hostname) at $(date)" You can try something like that in a cron job #!/bin/bash
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |