How to monitor internet connection for interruptions - for Mac OS X





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







14















I have subscribed to a new ISP and I am experiencing problems with this new ISP. The problems are several micro interruptions on the internet connection, kind of lags, that is probably related to timeouts on their proxies or in my connection to their network.



As these micro interruptions occur at random, I cannot prove that, because every time they send a technician to my office the problem is not detectable, specially because the service may be stable for 3, 4 hours and then start to show the problem again.



It is very annoying for two reasons. I am downloading something and then the download stops suddenly and I have to start again. Another reason is that I use a VoIP box connected to my phone using ethernet and this VoIP box loses connection every time, and my VoIP phone stops receiving/making calls, forcing me to restart the box every time I detect it and to stay hours with the phone down, without noticing.



My question is: How can I monitor the internet service for a period, telling me when the service is down, plot a graphic or something like that? Any tool or some way for monitoring the quality of the network or connection that can run on a Mac?



My idea is to have something to show them and prove I am right.










share|improve this question

























  • This Q may really be on topic, it fits the "good question" template (from How do I ask a question that may require recommending software? ) "I have <problem-x - network interruptions > that I don't know how to solve. I've already tried X, Y, Z (restart VoIP when I detect it) , but those programs don't work because this or that. How do I do this?" Is the only problem basically asking for a "Tool for monitoring internet connection" instead of saying "How to monitor internet connection for interruptions?

    – Xen2050
    Apr 6 '16 at 14:52


















14















I have subscribed to a new ISP and I am experiencing problems with this new ISP. The problems are several micro interruptions on the internet connection, kind of lags, that is probably related to timeouts on their proxies or in my connection to their network.



As these micro interruptions occur at random, I cannot prove that, because every time they send a technician to my office the problem is not detectable, specially because the service may be stable for 3, 4 hours and then start to show the problem again.



It is very annoying for two reasons. I am downloading something and then the download stops suddenly and I have to start again. Another reason is that I use a VoIP box connected to my phone using ethernet and this VoIP box loses connection every time, and my VoIP phone stops receiving/making calls, forcing me to restart the box every time I detect it and to stay hours with the phone down, without noticing.



My question is: How can I monitor the internet service for a period, telling me when the service is down, plot a graphic or something like that? Any tool or some way for monitoring the quality of the network or connection that can run on a Mac?



My idea is to have something to show them and prove I am right.










share|improve this question

























  • This Q may really be on topic, it fits the "good question" template (from How do I ask a question that may require recommending software? ) "I have <problem-x - network interruptions > that I don't know how to solve. I've already tried X, Y, Z (restart VoIP when I detect it) , but those programs don't work because this or that. How do I do this?" Is the only problem basically asking for a "Tool for monitoring internet connection" instead of saying "How to monitor internet connection for interruptions?

    – Xen2050
    Apr 6 '16 at 14:52














14












14








14


5






I have subscribed to a new ISP and I am experiencing problems with this new ISP. The problems are several micro interruptions on the internet connection, kind of lags, that is probably related to timeouts on their proxies or in my connection to their network.



As these micro interruptions occur at random, I cannot prove that, because every time they send a technician to my office the problem is not detectable, specially because the service may be stable for 3, 4 hours and then start to show the problem again.



It is very annoying for two reasons. I am downloading something and then the download stops suddenly and I have to start again. Another reason is that I use a VoIP box connected to my phone using ethernet and this VoIP box loses connection every time, and my VoIP phone stops receiving/making calls, forcing me to restart the box every time I detect it and to stay hours with the phone down, without noticing.



My question is: How can I monitor the internet service for a period, telling me when the service is down, plot a graphic or something like that? Any tool or some way for monitoring the quality of the network or connection that can run on a Mac?



My idea is to have something to show them and prove I am right.










share|improve this question
















I have subscribed to a new ISP and I am experiencing problems with this new ISP. The problems are several micro interruptions on the internet connection, kind of lags, that is probably related to timeouts on their proxies or in my connection to their network.



As these micro interruptions occur at random, I cannot prove that, because every time they send a technician to my office the problem is not detectable, specially because the service may be stable for 3, 4 hours and then start to show the problem again.



It is very annoying for two reasons. I am downloading something and then the download stops suddenly and I have to start again. Another reason is that I use a VoIP box connected to my phone using ethernet and this VoIP box loses connection every time, and my VoIP phone stops receiving/making calls, forcing me to restart the box every time I detect it and to stay hours with the phone down, without noticing.



My question is: How can I monitor the internet service for a period, telling me when the service is down, plot a graphic or something like that? Any tool or some way for monitoring the quality of the network or connection that can run on a Mac?



My idea is to have something to show them and prove I am right.







macos mac networking internet






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 6 '16 at 15:02









Xen2050

11.5k31637




11.5k31637










asked Oct 26 '10 at 18:19









SpaceDogSpaceDog

74321536




74321536













  • This Q may really be on topic, it fits the "good question" template (from How do I ask a question that may require recommending software? ) "I have <problem-x - network interruptions > that I don't know how to solve. I've already tried X, Y, Z (restart VoIP when I detect it) , but those programs don't work because this or that. How do I do this?" Is the only problem basically asking for a "Tool for monitoring internet connection" instead of saying "How to monitor internet connection for interruptions?

    – Xen2050
    Apr 6 '16 at 14:52



















  • This Q may really be on topic, it fits the "good question" template (from How do I ask a question that may require recommending software? ) "I have <problem-x - network interruptions > that I don't know how to solve. I've already tried X, Y, Z (restart VoIP when I detect it) , but those programs don't work because this or that. How do I do this?" Is the only problem basically asking for a "Tool for monitoring internet connection" instead of saying "How to monitor internet connection for interruptions?

    – Xen2050
    Apr 6 '16 at 14:52

















This Q may really be on topic, it fits the "good question" template (from How do I ask a question that may require recommending software? ) "I have <problem-x - network interruptions > that I don't know how to solve. I've already tried X, Y, Z (restart VoIP when I detect it) , but those programs don't work because this or that. How do I do this?" Is the only problem basically asking for a "Tool for monitoring internet connection" instead of saying "How to monitor internet connection for interruptions?

– Xen2050
Apr 6 '16 at 14:52





This Q may really be on topic, it fits the "good question" template (from How do I ask a question that may require recommending software? ) "I have <problem-x - network interruptions > that I don't know how to solve. I've already tried X, Y, Z (restart VoIP when I detect it) , but those programs don't work because this or that. How do I do this?" Is the only problem basically asking for a "Tool for monitoring internet connection" instead of saying "How to monitor internet connection for interruptions?

– Xen2050
Apr 6 '16 at 14:52










7 Answers
7






active

oldest

votes


















5














Applications->Utilities->Console.app


Take a look in the logs there as a start.



You could also look into ntop or Little Snitch.






share|improve this answer





















  • 1





    ntop.org < correct link to ntop (i think)

    – Frank Lämmer
    Mar 14 '15 at 13:35











  • Search for en0 or en1 once you open console.app (your network interface name(s)) to see network info.

    – Justin
    Sep 30 '15 at 20:52



















4














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)



The --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





share|improve this answer

































    2














    How about 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.






    share|improve this answer































      2














      Ping



      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 4.2.2.1
      PING 4.2.2.1 (4.2.2.1): 56 data bytes
      64 bytes from 4.2.2.1: icmp_seq=0 ttl=57 time=37.710 ms
      64 bytes from 4.2.2.1: icmp_seq=1 ttl=57 time=32.051 ms


      Arping



      To monitor your physical connection to the router, you can use arping, e.g.



      $ 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



      There is tcpdump which can dump traffic on a network. For example to dump all outgoing packets into port 80 and 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).






      share|improve this answer


























      • Is there an easy way (like a script) that automatically searches the tcpdump output looking for SYN packets that have no corresponding SYN-ACK reply?

        – Xen2050
        Apr 6 '16 at 14:55











      • @Xen2050 I think I would grep the dump or output by looking for S flag like: sudo tcpdump -i en0 -nl | grep -C5 "Flags .S", from there, if you've ack in the context (extra | grep ack), than means something responded. So you need something opposite. I think you you find some awk/sed syntax that can find 5 SYN packet in a row, then it can alert that something wrong (unless you're contacting some dead host).

        – kenorb
        Apr 6 '16 at 15:06













      • For live monitoring, ping -A www.yahoo.com will beep when connection goes down. While you can use an IP address, using a human-readable address will test DNS failures as well.

        – brianfit
        Jan 23 '17 at 15:09





















      1














      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.




      https://itunes.apple.com/us/app/network-logger-pro/id764324406?mt=12



      It's $10 though :/






      share|improve this answer































        1














        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.






        share|improve this answer


























        • Interesting, but you got to the point. Yes, my connection unfortunately is by cable modem, but it is a brand new (it was installed by them a month ago). I suspect the problem is their cable network. I never liked cable internet (I was forced to use them, because there's no other broadband company offering services in my region).

          – SpaceDog
          Oct 27 '10 at 12:48



















        0














        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:



        https://github.com/superman-lopez/monitor-timeouts



        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`."





        share|improve this answer


























        • Welcome to Super User! Your script is short enough to include in your post; you should edit your answer to include it

          – bertieb
          Mar 8 at 8:39











        • Thanks for the suggestion

          – Superman.Lopez
          Mar 8 at 9:03












        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "3"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f203614%2fhow-to-monitor-internet-connection-for-interruptions-for-mac-os-x%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        7 Answers
        7






        active

        oldest

        votes








        7 Answers
        7






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        5














        Applications->Utilities->Console.app


        Take a look in the logs there as a start.



        You could also look into ntop or Little Snitch.






        share|improve this answer





















        • 1





          ntop.org < correct link to ntop (i think)

          – Frank Lämmer
          Mar 14 '15 at 13:35











        • Search for en0 or en1 once you open console.app (your network interface name(s)) to see network info.

          – Justin
          Sep 30 '15 at 20:52
















        5














        Applications->Utilities->Console.app


        Take a look in the logs there as a start.



        You could also look into ntop or Little Snitch.






        share|improve this answer





















        • 1





          ntop.org < correct link to ntop (i think)

          – Frank Lämmer
          Mar 14 '15 at 13:35











        • Search for en0 or en1 once you open console.app (your network interface name(s)) to see network info.

          – Justin
          Sep 30 '15 at 20:52














        5












        5








        5







        Applications->Utilities->Console.app


        Take a look in the logs there as a start.



        You could also look into ntop or Little Snitch.






        share|improve this answer















        Applications->Utilities->Console.app


        Take a look in the logs there as a start.



        You could also look into ntop or Little Snitch.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 28 '16 at 18:06









        effel

        1033




        1033










        answered Oct 26 '10 at 18:29









        CaseyITCaseyIT

        3,05321519




        3,05321519








        • 1





          ntop.org < correct link to ntop (i think)

          – Frank Lämmer
          Mar 14 '15 at 13:35











        • Search for en0 or en1 once you open console.app (your network interface name(s)) to see network info.

          – Justin
          Sep 30 '15 at 20:52














        • 1





          ntop.org < correct link to ntop (i think)

          – Frank Lämmer
          Mar 14 '15 at 13:35











        • Search for en0 or en1 once you open console.app (your network interface name(s)) to see network info.

          – Justin
          Sep 30 '15 at 20:52








        1




        1





        ntop.org < correct link to ntop (i think)

        – Frank Lämmer
        Mar 14 '15 at 13:35





        ntop.org < correct link to ntop (i think)

        – Frank Lämmer
        Mar 14 '15 at 13:35













        Search for en0 or en1 once you open console.app (your network interface name(s)) to see network info.

        – Justin
        Sep 30 '15 at 20:52





        Search for en0 or en1 once you open console.app (your network interface name(s)) to see network info.

        – Justin
        Sep 30 '15 at 20:52













        4














        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)



        The --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





        share|improve this answer






























          4














          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)



          The --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





          share|improve this answer




























            4












            4








            4







            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)



            The --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





            share|improve this answer















            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)



            The --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






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Aug 21 '18 at 17:10









            Andrew-Dufresne

            4202611




            4202611










            answered May 24 '17 at 10:44









            Tony LambertTony Lambert

            1665




            1665























                2














                How about 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.






                share|improve this answer




























                  2














                  How about 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.






                  share|improve this answer


























                    2












                    2








                    2







                    How about 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.






                    share|improve this answer













                    How about 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.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Oct 26 '10 at 18:47









                    Daniel BeckDaniel Beck

                    93.5k12236288




                    93.5k12236288























                        2














                        Ping



                        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 4.2.2.1
                        PING 4.2.2.1 (4.2.2.1): 56 data bytes
                        64 bytes from 4.2.2.1: icmp_seq=0 ttl=57 time=37.710 ms
                        64 bytes from 4.2.2.1: icmp_seq=1 ttl=57 time=32.051 ms


                        Arping



                        To monitor your physical connection to the router, you can use arping, e.g.



                        $ 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



                        There is tcpdump which can dump traffic on a network. For example to dump all outgoing packets into port 80 and 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).






                        share|improve this answer


























                        • Is there an easy way (like a script) that automatically searches the tcpdump output looking for SYN packets that have no corresponding SYN-ACK reply?

                          – Xen2050
                          Apr 6 '16 at 14:55











                        • @Xen2050 I think I would grep the dump or output by looking for S flag like: sudo tcpdump -i en0 -nl | grep -C5 "Flags .S", from there, if you've ack in the context (extra | grep ack), than means something responded. So you need something opposite. I think you you find some awk/sed syntax that can find 5 SYN packet in a row, then it can alert that something wrong (unless you're contacting some dead host).

                          – kenorb
                          Apr 6 '16 at 15:06













                        • For live monitoring, ping -A www.yahoo.com will beep when connection goes down. While you can use an IP address, using a human-readable address will test DNS failures as well.

                          – brianfit
                          Jan 23 '17 at 15:09


















                        2














                        Ping



                        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 4.2.2.1
                        PING 4.2.2.1 (4.2.2.1): 56 data bytes
                        64 bytes from 4.2.2.1: icmp_seq=0 ttl=57 time=37.710 ms
                        64 bytes from 4.2.2.1: icmp_seq=1 ttl=57 time=32.051 ms


                        Arping



                        To monitor your physical connection to the router, you can use arping, e.g.



                        $ 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



                        There is tcpdump which can dump traffic on a network. For example to dump all outgoing packets into port 80 and 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).






                        share|improve this answer


























                        • Is there an easy way (like a script) that automatically searches the tcpdump output looking for SYN packets that have no corresponding SYN-ACK reply?

                          – Xen2050
                          Apr 6 '16 at 14:55











                        • @Xen2050 I think I would grep the dump or output by looking for S flag like: sudo tcpdump -i en0 -nl | grep -C5 "Flags .S", from there, if you've ack in the context (extra | grep ack), than means something responded. So you need something opposite. I think you you find some awk/sed syntax that can find 5 SYN packet in a row, then it can alert that something wrong (unless you're contacting some dead host).

                          – kenorb
                          Apr 6 '16 at 15:06













                        • For live monitoring, ping -A www.yahoo.com will beep when connection goes down. While you can use an IP address, using a human-readable address will test DNS failures as well.

                          – brianfit
                          Jan 23 '17 at 15:09
















                        2












                        2








                        2







                        Ping



                        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 4.2.2.1
                        PING 4.2.2.1 (4.2.2.1): 56 data bytes
                        64 bytes from 4.2.2.1: icmp_seq=0 ttl=57 time=37.710 ms
                        64 bytes from 4.2.2.1: icmp_seq=1 ttl=57 time=32.051 ms


                        Arping



                        To monitor your physical connection to the router, you can use arping, e.g.



                        $ 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



                        There is tcpdump which can dump traffic on a network. For example to dump all outgoing packets into port 80 and 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).






                        share|improve this answer















                        Ping



                        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 4.2.2.1
                        PING 4.2.2.1 (4.2.2.1): 56 data bytes
                        64 bytes from 4.2.2.1: icmp_seq=0 ttl=57 time=37.710 ms
                        64 bytes from 4.2.2.1: icmp_seq=1 ttl=57 time=32.051 ms


                        Arping



                        To monitor your physical connection to the router, you can use arping, e.g.



                        $ 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



                        There is tcpdump which can dump traffic on a network. For example to dump all outgoing packets into port 80 and 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).







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited Jan 23 '17 at 15:28

























                        answered Apr 3 '16 at 15:18









                        kenorbkenorb

                        11.7k1580118




                        11.7k1580118













                        • Is there an easy way (like a script) that automatically searches the tcpdump output looking for SYN packets that have no corresponding SYN-ACK reply?

                          – Xen2050
                          Apr 6 '16 at 14:55











                        • @Xen2050 I think I would grep the dump or output by looking for S flag like: sudo tcpdump -i en0 -nl | grep -C5 "Flags .S", from there, if you've ack in the context (extra | grep ack), than means something responded. So you need something opposite. I think you you find some awk/sed syntax that can find 5 SYN packet in a row, then it can alert that something wrong (unless you're contacting some dead host).

                          – kenorb
                          Apr 6 '16 at 15:06













                        • For live monitoring, ping -A www.yahoo.com will beep when connection goes down. While you can use an IP address, using a human-readable address will test DNS failures as well.

                          – brianfit
                          Jan 23 '17 at 15:09





















                        • Is there an easy way (like a script) that automatically searches the tcpdump output looking for SYN packets that have no corresponding SYN-ACK reply?

                          – Xen2050
                          Apr 6 '16 at 14:55











                        • @Xen2050 I think I would grep the dump or output by looking for S flag like: sudo tcpdump -i en0 -nl | grep -C5 "Flags .S", from there, if you've ack in the context (extra | grep ack), than means something responded. So you need something opposite. I think you you find some awk/sed syntax that can find 5 SYN packet in a row, then it can alert that something wrong (unless you're contacting some dead host).

                          – kenorb
                          Apr 6 '16 at 15:06













                        • For live monitoring, ping -A www.yahoo.com will beep when connection goes down. While you can use an IP address, using a human-readable address will test DNS failures as well.

                          – brianfit
                          Jan 23 '17 at 15:09



















                        Is there an easy way (like a script) that automatically searches the tcpdump output looking for SYN packets that have no corresponding SYN-ACK reply?

                        – Xen2050
                        Apr 6 '16 at 14:55





                        Is there an easy way (like a script) that automatically searches the tcpdump output looking for SYN packets that have no corresponding SYN-ACK reply?

                        – Xen2050
                        Apr 6 '16 at 14:55













                        @Xen2050 I think I would grep the dump or output by looking for S flag like: sudo tcpdump -i en0 -nl | grep -C5 "Flags .S", from there, if you've ack in the context (extra | grep ack), than means something responded. So you need something opposite. I think you you find some awk/sed syntax that can find 5 SYN packet in a row, then it can alert that something wrong (unless you're contacting some dead host).

                        – kenorb
                        Apr 6 '16 at 15:06







                        @Xen2050 I think I would grep the dump or output by looking for S flag like: sudo tcpdump -i en0 -nl | grep -C5 "Flags .S", from there, if you've ack in the context (extra | grep ack), than means something responded. So you need something opposite. I think you you find some awk/sed syntax that can find 5 SYN packet in a row, then it can alert that something wrong (unless you're contacting some dead host).

                        – kenorb
                        Apr 6 '16 at 15:06















                        For live monitoring, ping -A www.yahoo.com will beep when connection goes down. While you can use an IP address, using a human-readable address will test DNS failures as well.

                        – brianfit
                        Jan 23 '17 at 15:09







                        For live monitoring, ping -A www.yahoo.com will beep when connection goes down. While you can use an IP address, using a human-readable address will test DNS failures as well.

                        – brianfit
                        Jan 23 '17 at 15:09













                        1














                        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.




                        https://itunes.apple.com/us/app/network-logger-pro/id764324406?mt=12



                        It's $10 though :/






                        share|improve this answer




























                          1














                          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.




                          https://itunes.apple.com/us/app/network-logger-pro/id764324406?mt=12



                          It's $10 though :/






                          share|improve this answer


























                            1












                            1








                            1







                            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.




                            https://itunes.apple.com/us/app/network-logger-pro/id764324406?mt=12



                            It's $10 though :/






                            share|improve this answer













                            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.




                            https://itunes.apple.com/us/app/network-logger-pro/id764324406?mt=12



                            It's $10 though :/







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Sep 30 '15 at 20:45









                            JustinJustin

                            180119




                            180119























                                1














                                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.






                                share|improve this answer


























                                • Interesting, but you got to the point. Yes, my connection unfortunately is by cable modem, but it is a brand new (it was installed by them a month ago). I suspect the problem is their cable network. I never liked cable internet (I was forced to use them, because there's no other broadband company offering services in my region).

                                  – SpaceDog
                                  Oct 27 '10 at 12:48
















                                1














                                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.






                                share|improve this answer


























                                • Interesting, but you got to the point. Yes, my connection unfortunately is by cable modem, but it is a brand new (it was installed by them a month ago). I suspect the problem is their cable network. I never liked cable internet (I was forced to use them, because there's no other broadband company offering services in my region).

                                  – SpaceDog
                                  Oct 27 '10 at 12:48














                                1












                                1








                                1







                                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.






                                share|improve this answer















                                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.







                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited Apr 25 '16 at 15:01

























                                answered Oct 26 '10 at 20:11









                                Jamie CoxJamie Cox

                                60449




                                60449













                                • Interesting, but you got to the point. Yes, my connection unfortunately is by cable modem, but it is a brand new (it was installed by them a month ago). I suspect the problem is their cable network. I never liked cable internet (I was forced to use them, because there's no other broadband company offering services in my region).

                                  – SpaceDog
                                  Oct 27 '10 at 12:48



















                                • Interesting, but you got to the point. Yes, my connection unfortunately is by cable modem, but it is a brand new (it was installed by them a month ago). I suspect the problem is their cable network. I never liked cable internet (I was forced to use them, because there's no other broadband company offering services in my region).

                                  – SpaceDog
                                  Oct 27 '10 at 12:48

















                                Interesting, but you got to the point. Yes, my connection unfortunately is by cable modem, but it is a brand new (it was installed by them a month ago). I suspect the problem is their cable network. I never liked cable internet (I was forced to use them, because there's no other broadband company offering services in my region).

                                – SpaceDog
                                Oct 27 '10 at 12:48





                                Interesting, but you got to the point. Yes, my connection unfortunately is by cable modem, but it is a brand new (it was installed by them a month ago). I suspect the problem is their cable network. I never liked cable internet (I was forced to use them, because there's no other broadband company offering services in my region).

                                – SpaceDog
                                Oct 27 '10 at 12:48











                                0














                                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:



                                https://github.com/superman-lopez/monitor-timeouts



                                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`."





                                share|improve this answer


























                                • Welcome to Super User! Your script is short enough to include in your post; you should edit your answer to include it

                                  – bertieb
                                  Mar 8 at 8:39











                                • Thanks for the suggestion

                                  – Superman.Lopez
                                  Mar 8 at 9:03
















                                0














                                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:



                                https://github.com/superman-lopez/monitor-timeouts



                                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`."





                                share|improve this answer


























                                • Welcome to Super User! Your script is short enough to include in your post; you should edit your answer to include it

                                  – bertieb
                                  Mar 8 at 8:39











                                • Thanks for the suggestion

                                  – Superman.Lopez
                                  Mar 8 at 9:03














                                0












                                0








                                0







                                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:



                                https://github.com/superman-lopez/monitor-timeouts



                                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`."





                                share|improve this answer















                                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:



                                https://github.com/superman-lopez/monitor-timeouts



                                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`."






                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited Mar 11 at 3:49

























                                answered Mar 8 at 6:34









                                Superman.LopezSuperman.Lopez

                                11




                                11













                                • Welcome to Super User! Your script is short enough to include in your post; you should edit your answer to include it

                                  – bertieb
                                  Mar 8 at 8:39











                                • Thanks for the suggestion

                                  – Superman.Lopez
                                  Mar 8 at 9:03



















                                • Welcome to Super User! Your script is short enough to include in your post; you should edit your answer to include it

                                  – bertieb
                                  Mar 8 at 8:39











                                • Thanks for the suggestion

                                  – Superman.Lopez
                                  Mar 8 at 9:03

















                                Welcome to Super User! Your script is short enough to include in your post; you should edit your answer to include it

                                – bertieb
                                Mar 8 at 8:39





                                Welcome to Super User! Your script is short enough to include in your post; you should edit your answer to include it

                                – bertieb
                                Mar 8 at 8:39













                                Thanks for the suggestion

                                – Superman.Lopez
                                Mar 8 at 9:03





                                Thanks for the suggestion

                                – Superman.Lopez
                                Mar 8 at 9:03


















                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Super User!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f203614%2fhow-to-monitor-internet-connection-for-interruptions-for-mac-os-x%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                How do I know what Microsoft account the skydrive app is syncing to?

                                When does type information flow backwards in C++?

                                Grease: Live!