Dead gateway detection

B

balcer

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
 
M

Mike

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
 
B

balcersk

Mike said:
(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
 
B

balcersk

Mike said:
(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
 
G

Guillaume Marcais

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/smokeping/

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
 
B

balcer

Guillaume Marcais napisa³(a):
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/smokeping/

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top