Re: Script to ping, traceroute a destination and record the time

2009-10-29 Thread Frans Haarman
2009/10/29 Kasper Adel 

> thanks all for answering.
>
> Traceroute will allow me to find out if during the short period of
> application disconnect is whether its an app problem or the network
> topology
> changes and where (which router) the packets couldnt get across.
>
> Cheers,
> Kim
>
> On Thu, Oct 29, 2009 at 4:43 PM, Toni Mueller 
> wrote:
>
> > Hi,
> >
> > On Thu, 29.10.2009 at 16:26:49 +0200, Kasper Adel 
> > wrote:
> > > I am trying to troubleshoot a problem that is totally random and the
> one
> > > idea that would help me is to have a bash script that will ping a few
> > > destinations every minute, then do a traceroute to these destinations,
> > > record the time and all that output in a file. then the whole process
> > would
> > > repeat minute.
> >
> > I don't know what exactly you are going to do with the traceroute,
> > which is both hard to implement, given your timing requirements, and
> > tedious to evaluate, but if you could be content with pings and packet
> > loss, I can recommend using Smokeping with aggressive settings, and/or
> > some other things to trigger a traceroute in case of a problem.
> >
> >
> > Kind regards,
> > --Toni++
>
>
I am playing with hping to monitor changes in "traceroutes". You can
specify which hop you want to monitor to a certain destination:

# /usr/local/sbin/hping -c 1 -1 --traceroute --tr-keep-ttl --ttl 4
openbsd.org
HPING openbsd.org (vic0 199.185.137.3): icmp mode set, 28 headers + 0 data
bytes
hop=4 TTL 0 during transit from ip=149.6.129.97 name=
vl250.mpd03.ams03.atlas.cogentco.com
hop=4 hoprtt=9.5 ms

As you can see hping will only output info about the 4th hop. Might be
usefull.

Regards,
-- Frans



Re: Script to ping, traceroute a destination and record the time

2009-10-29 Thread Kasper Adel
thanks all for answering.

Traceroute will allow me to find out if during the short period of
application disconnect is whether its an app problem or the network topology
changes and where (which router) the packets couldnt get across.

Cheers,
Kim

On Thu, Oct 29, 2009 at 4:43 PM, Toni Mueller  wrote:

> Hi,
>
> On Thu, 29.10.2009 at 16:26:49 +0200, Kasper Adel 
> wrote:
> > I am trying to troubleshoot a problem that is totally random and the one
> > idea that would help me is to have a bash script that will ping a few
> > destinations every minute, then do a traceroute to these destinations,
> > record the time and all that output in a file. then the whole process
> would
> > repeat minute.
>
> I don't know what exactly you are going to do with the traceroute,
> which is both hard to implement, given your timing requirements, and
> tedious to evaluate, but if you could be content with pings and packet
> loss, I can recommend using Smokeping with aggressive settings, and/or
> some other things to trigger a traceroute in case of a problem.
>
>
> Kind regards,
> --Toni++



Re: Script to ping, traceroute a destination and record the time

2009-10-29 Thread David Walker
> If you can't whip this up yourself in a matter of 2 minutes they
> have the wrong person debugging it.

+1

If you can't already write this don't panic - it is possibly the best
opportunity you may have to get your feet wet.

Motivation - fix that problem.
Interesting - who doesn't like learning?
Simplicity - it doesn't get much easier.

If I can do it you can do it.

Here's a starter.
Read man sh.
Especially "Input/output redirection". Then read "Command syntax".

Remember a script (as per your request) is to save you doing this
stuff manually (too lazy, not quick enough, busy sleeping, etcetera).
In other words you can type this stuff at the shell instead and see
what it does. :]

Not only will you learn how to script your command vocabulary will
grow and grow ...

I am very much the beginner @ shell scripts but experience on another
platform tells me you won't get a better opportunity.

*cough*
ping -c 1 microsoft.com | grep received > report.file && echo Yeehah!
*sneeze*
man: sed, grep, cat, etcetera.

Not what you want but a push in the right direction.

Best wishes.



Re: Script to ping, traceroute a destination and record the time

2009-10-29 Thread John Jackson
On Thu, Oct 29, 2009 at 04:26:49PM +0200, Kasper Adel wrote:
> Hi,
> 
> I am trying to troubleshoot a problem that is totally random and the one
> idea that would help me is to have a bash script that will ping a few
> destinations every minute, then do a traceroute to these destinations,
> record the time and all that output in a file. then the whole process would
> repeat minute.

You may want to look at 'mtr' or 'mtr-tiny'.  They should be in ports.

> 
> This way, i'll be able to look at the script at the end of each day and find
> out if these destinations were reachable when a problem was reported.
> 
> The problem/disconnect happens for a few minutes only.
> 
> Can any one help me get a script to do that?
> 
> Thanks,
> Kim
> 

John



Re: Script to ping, traceroute a destination and record the time

2009-10-29 Thread Jason Dixon
On Thu, Oct 29, 2009 at 04:26:49PM +0200, Kasper Adel wrote:
> Hi,
> 
> I am trying to troubleshoot a problem that is totally random and the one
> idea that would help me is to have a bash script that will ping a few
> destinations every minute, then do a traceroute to these destinations,
> record the time and all that output in a file. then the whole process would
> repeat minute.
> 
> This way, i'll be able to look at the script at the end of each day and find
> out if these destinations were reachable when a problem was reported.
> 
> The problem/disconnect happens for a few minutes only.
> 
> Can any one help me get a script to do that?

If you can't whip this up yourself in a matter of 2 minutes they
have the wrong person debugging it.

-- 
Jason Dixon
DixonGroup Consulting
http://www.dixongroup.net/



Re: Script to ping, traceroute a destination and record the time

2009-10-29 Thread Toni Mueller
Hi,

On Thu, 29.10.2009 at 16:26:49 +0200, Kasper Adel  wrote:
> I am trying to troubleshoot a problem that is totally random and the one
> idea that would help me is to have a bash script that will ping a few
> destinations every minute, then do a traceroute to these destinations,
> record the time and all that output in a file. then the whole process would
> repeat minute.

I don't know what exactly you are going to do with the traceroute,
which is both hard to implement, given your timing requirements, and
tedious to evaluate, but if you could be content with pings and packet
loss, I can recommend using Smokeping with aggressive settings, and/or
some other things to trigger a traceroute in case of a problem.


Kind regards,
--Toni++



Script to ping, traceroute a destination and record the time

2009-10-29 Thread Kasper Adel
Hi,

I am trying to troubleshoot a problem that is totally random and the one
idea that would help me is to have a bash script that will ping a few
destinations every minute, then do a traceroute to these destinations,
record the time and all that output in a file. then the whole process would
repeat minute.

This way, i'll be able to look at the script at the end of each day and find
out if these destinations were reachable when a problem was reported.

The problem/disconnect happens for a few minutes only.

Can any one help me get a script to do that?

Thanks,
Kim