balcer
6/23/2005 6:48:00 PM
Mike wrote:
>>Is there some way to detect if gateway is dead?
>>I am not good at networking aspects, all I know is that it is
>>not as trivial as use ruby/ping :) Jacek Balcerski
>>
>
>
> (focus from a network point of view, not necessarily a Ruby point of view)
>
> Well, pinging isn't that great because it just says "I can't get there" and
> tells you nothing about where the connection failed. Plus, ICMP traffic
> (specifically pinging) is frequently blocked on many networks at the gateway
> level.
>
> That aside, if you use tracert / traceroute (pending your OS), you can
> actually find out where outtages are occuring.
>
> Another thing is what are you exactly trying to monitor? Just that the
> machine is up and running or that it is successfully routing traffic to
> external sites? One thing I've done in the past at a previous company was
> made a simple script that would GET a static HTML page. If it's able to
> connect and see the very basic content that I could always compare against
> (since it never changed), I knew I was routing externally through my
> gateway. If it fails, then there's either a problem with your webserver or
> the gateway. Through the use of ping and traceroute, you can probably
> identify which is which.
>
> Another aspect that may be a consideration is if your gateway also performs
> DNS. If so, then you'll likely want to do these tests with both IP and the
> domain name, to ensure that DNS works to resolve the name.
>
> I would not rule out ping as a useful tool, but I agree that it's not the
> only thing that's needed to positively identify a successful connection.
>
> As you can see, there's tons of options, but it will largely come down to
> your -specific- needs and setup.
>
> -M
>
>
>
Well what I'am trying to do is to write script witch logs all
"internet holes" their times etc etc. My ISP has an DSL modem
connected to localnetwork (i am on that network too). The second
modem is inside ISP building. Ones for 10 minutes, for few seconds I
have no connection to gateway (I have public addres so my gateway is in
ISP bulding). I KNOW this is problem beetwean dsl modems. I'am trying to
prove that thay cheat me a little:). The best way i think is to sumarise
frequency and length of non working internet times. That's why this idea
has came, to write simple ruby script. So in this particular case ICMP
ping would be enough but I see no way to call it from Ruby.
Thanks, for your answer, sorry for english
Jacek