[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Dead gateway detection

balcer

6/23/2005 9:13:00 AM

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
6 Answers

Mike

6/23/2005 2:16:00 PM

0

> 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



balcer

6/23/2005 6:48:00 PM

0

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

balcer

6/23/2005 6:52:00 PM

0

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

Guillaume Marcais

6/23/2005 8:09:00 PM

0

On Fri, 2005-06-24 at 03:55 +0900, balcersk wrote:

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

Not that I am trying to steer you away from Ruby, but have you look at
tools like smokeping by Tobias Oetiker:

http://people.ee.ethz.ch/~oetiker/webtools/...

It should do what you want and in the most pretty way.

Otherwise, look in RAA for net-ping, icmpmodule or icmpping. I have used
icmpmodule with quite some success, on both Linux and Windows.

Hope it helps,
Guillaume



balcer

6/24/2005 7:00:00 AM

0

Sorry for my third message my thunderbird just went crazy:)

balcer

6/24/2005 7:01:00 AM

0

Guillaume Marcais napisa3(a):
> On Fri, 2005-06-24 at 03:55 +0900, balcersk wrote:
>
>
>>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.
>>
>
>
> Not that I am trying to steer you away from Ruby, but have you look at
> tools like smokeping by Tobias Oetiker:
>
> http://people.ee.ethz.ch/~oetiker/webtools/...
>
> It should do what you want and in the most pretty way.
>
> Otherwise, look in RAA for net-ping, icmpmodule or icmpping. I have used
> icmpmodule with quite some success, on both Linux and Windows.
>
> Hope it helps,
> Guillaume
>
>
>
Many thanks, it just what i need.
Jacek Balcerski