Re: ping replacment?

From: Floyd Davidson (floyd_at_barrow.com)
Date: 09/03/03

  • Next message: Monzai: "Re: Strange email"
    Date: 03 Sep 2003 04:11:39 -0800
    
    

    jorn.dahl-stamnes@nospam.novit.no (Jørn Dahl-Stamnes) wrote:
    >In article <87r830prml.fld@barrow.com>, Floyd Davidson <floyd@barrow.com> wrote:
    >>
    >>What are you trying to accomplish?
    >
    >I watched a network connection that somethime lost the connection. I used ping
    >to see if there was any delay in the network. But when the network lost the
    >connection, it was not detected by ping when I looked at delay.
    >
    >I wanted to see when I lost the connection and when it was OK again. And I
    >want to do it without having to look at the screen all the time, something
    >like
    >
    ># ping <some arguments> | tee ping.out
    >
    >go home and then look a ping.out file the next morning and say "aaah.. at 7 pm
    >it failed..."

    Write a small script with a loop that executes ping at some
    regular interval. Depending on what kind of resolution you need,
    that can be seconds or minutes... whatever. You only need to
    log when it fails, and thus the log will be short and sweet,
    and easy to read.

    Here is an example that will give you 10 second resolution on
    when the ping fails, and 1 second resolution on when it again
    succeeds.

    #!/bin/sh
    #
    host=192.168.0.2
    interval=10
    while true
    do
       date
       echo $host $interval

       if ! ping -c1 -w3 $host 2>&1 > /dev/null
       then
          date >> ping.log
          echo " ping FAILED" >> ping.log
          echo "*************" >> ping.log
          sleep 1
          continue
       fi
       sleep $interval
    done

    -- 
    Floyd L. Davidson           <http://web.newsguy.com/floyd_davidson>
    Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com
    

  • Next message: Monzai: "Re: Strange email"

    Relevant Pages

    • Re: Help! Lost my internal network after installing Wireless ADSL modem/router.hub.WiFi
      ... before to set up a home network with the Wizard. ... Internet connection: Local Area Connection ... >>I have done the ping tests. ...
      (microsoft.public.windowsxp.network_web)
    • Re: XP & Win2K N/w blues
      ... >network in my office and behaves absolutely normal. ... But, when I ping from the XP to Win2K machine, the ping ... >Ethernet adapter Local Area Connection: ...
      (microsoft.public.windowsxp.network_web)
    • Re: Can not connect to internet after ME to XP upgrade
      ... Ping yahoo.com and yahoo.com 80 fails ... mentioned that this firewall needs to be reinstalled and I continued with it. ... Select Never dial a connection. ... Network card is "SMC EZ 10/100 SMC1211TX". ...
      (microsoft.public.windowsxp.network_web)
    • Re: self ping fails
      ... Badcomputer CAN'T ping its own IP address ... Badcomputer CAN ping other computers on the network ... I get an excellent connection in all permutations, ...
      (microsoft.public.windowsxp.network_web)
    • Re: Problems with access to a web page
      ... Ethernet adapter Local Area Connection: ... > Connection to host lost. ... > and got exactly the same 0 length response ... Ping at least still works ...
      (microsoft.public.windows.inetexplorer.ie6.browser)