If you use the following:
ping -A -i 10 --apple-time 10.20.30.40 > monitor.txt
It will run continuously until stopped and ping every 10 seconds to
10.20.30.40 (change for your address)
--apple-time means that it will log the time of each ping so you can see failures. Like so:
11:33:10.793801 64 bytes from 10.20.30.40: icmp_seq=0 ttl=58 time=27.744 ms 11:33:11.780250 64 bytes from 10.20.30.40: icmp_seq=1 ttl=58 time=9.757 ms 11:33:12.781136 64 bytes from 10.20.30.40: icmp_seq=2 ttl=58 time=10.150 ms 11:33:13.782932 64 bytes from 10.20.30.40: icmp_seq=3 ttl=58 time=11.779 ms 11:33:14.785446 64 bytes from 10.20.30.40: icmp_seq=4 ttl=58 time=11.254 ms
- like ping but with bit of visuals in the terminal, making it easier too spot interruptions/slow moments.
If you have homeBrew, then
brew install prettyping will install it and
prettyping somedomain.com will keep pinging and showing bars…
This app logs your connection status and even claims it is used internally by Apple.
Log your network outages, graph speeds over time, and more. Network
Logger Pro can also be used to monitor web sites and produce
historical graphs of their speeds, outages, and response times.
It’s $10 though :/
To monitor internet connection, you can simply use
ping command. It just sends ICMP ECHO_REQUEST and expects the response.
Ping your router IP, when it’s not responding, you can report to your ISP as internet interruption.
If your router has firewall, use
arping instead, or simply chose another remote host, e.g.
$ ping 18.104.22.168 PING 22.214.171.124 (126.96.36.199): 56 data bytes 64 bytes from 188.8.131.52: icmp_seq=0 ttl=57 time=37.710 ms 64 bytes from 184.108.40.206: icmp_seq=1 ttl=57 time=32.051 ms
To monitor your physical connection to the router, you can use
$ sudo arping 192.168.0.1
This is especially useful when your WiFi keeps dropping and your router doesn’t respond to standard ICMP packets. Install via Brew (
brew install arping).
tcpdump which can dump traffic on a network. For example to dump all outgoing packets into port
443, the syntax could be:
sudo tcpdump -i en0 port http or port https
To write into the file, add
-w file, then read it via
-r file. This will include exact timestamps of each network packets being received or sent.
To check whether the internet is interrupted, look for SYN packets (in Flags section) which your computer sends, and for each one the server should reply with a SYN-ACK. If that is not happening and there is no any traffic going back (just SYN packets, then there is no internet connection).
For my own usage, I have written a simple Bash script to check for this. It uses
ping as way to monitor for timeouts, exactly as most answer suggest you do. The advantage of the script is that the output on your screen only shows the pings that timed out, rather than including successful pings as well. In addition you can pass a parameter for the duration of the monitoring, rather than the number of ping attempts. In short it’s just a wrapper for the following:
ping google.com -i 1 -c 60 | grep "timeout\|statistics\|transmitted\|avg" Its source and simple installation instructions are available at the below link:
I tested the script on macOS and Ubuntu Linux.
#!/bin/bash #Usage: ./monitor-timeouts.sh [duration] [target] #example: ./monitor-timeouts.sh 60 192.168.1.1 minutes=$1 target=$2 if [ $# -eq 0 ]; then minutes=1 target=google.com fi if [ -z "$2" ]; then target=google.com fi pings=$((60 * $minutes)) system=`uname` if [[ $system == *"Linux"* ]]; then extraflag="-O" fi echo "Start monitor for network timeouts at `date` for $minutes minute(s)." echo "Target host: $target" ping $target -i 1 -c $pings $extraflag | grep -i "timeout\|unreachable\|no answer\|statistics\|transmitted\|avg" echo "End monitoring at `date`."
ping running in Terminal? Just find a server that’s on and responds to pings. While it doesn’t show the exact times, it gives you some kind of proof that something’s wrong.
Edited to add: I’ve used it myself a while ago for a similar. While they maintained that my (aging, to be honest) wireless access point might be at fault, since they didn’t find anything, “I have ping timeouts at least once every hour” helped in getting the engineer to check on stuff.
That was one of the symptoms I was having, besides low throughput. It turned out to be the cable modem. The good news is you may not have to convince anybody to get a new cable modem. My ISP turned out to have the policy that you could just swap your cable modem for a new one pretty much at will. Check and see if yours will do that.