Since start of Corona times, I use my internet at home also for work. So its reliability and performance has become crucial. Performance seems to be stable, I test it using speedtest.net:
But regarding the reliability, I get outages almost every day. Very awkward during a video conference in your job. So, first step is to check whether the outage comes from the internet provider or from the WLAN.
It can be that your WLAN router needs to change channels which will be bad enough to cut you off a video conference although your internet connection from the router to the internet works perfectly fine.
So I got the idea to use my raspberry pi which is connected to the router via cable (not WLAN) to check if there are internet outages (not WLAN outages):
I use a screen session to monitor the network connection. A screen session will survive users closing the terminal window, network outages and it never times out. See below:
To install screen, I ran on raspian:
apt-get update
apt-get install screen
To start a screen session, run
screen
and follow the instructions (to type Enter ;).
To list all screen sessions, type
screen -ls
Once you re-login, you can re-attach to a screen session (if there is only one) using
screen -x
Inside the screen session, to detect network errors, I used the command
ping -O 8.8.8.8 2>&1| while read a; do echo $(date; echo $a); done | grep -v time
This command will only output a line in case of an issue, and it will also write a timestamp like this:
pi@raspberrypi:~ $ ping -O 8.8.8.8 2>&1| while read a; do echo $(date; echo $a); done | grep -v time
Mon 01 Mar 2021 10:58:49 AM CET PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
Mon 01 Mar 2021 10:59:01 AM CET ping: sendmsg: Network is unreachable
Learnings
ping 8.8.8.8 2>&1| while read a; do echo $(date; echo $a); done | grep -v time
ping 8.8.8.8 2>&1| grep -v time | while read a; do echo $(date; echo $a); done
Keine Kommentare:
Kommentar veröffentlichen