[mrtg] Re: Mesuring latency with MRTG (fwd)

Simon Watts swatts at connect.com.au
Thu Oct 11 00:54:13 MEST 2001


For all those that are interested, here is a copy of the script.

Firstly, my disclaimer.  I am a Network Architect, _NOT_ a programmer, so
do not expect this to be the most robust or well written perl script you
have seen.  However, it works very nicely for me.

I wrote this script because I needed to know round trip times between two
locations, and as I work for an ISP, many of these locations (particularly
regional ones) do not have servers there that can have scripts run on
them.


What you need:

1.  The source of the pings must be a Cisco router, from this source you
can gather round trip times to any other host on the internet

2.  The source Cisco router must support the Cisco Ping Mib.  Most Cisco
IOS's do support this, but you can check at
ftp://ftp.cisco.com/pub/mibs/supportlists/[PlatformName]

3.  You must have SNMP read/write access to the source Cisco router.  
  eg:
  snmp-server community rw-string RW 99
  access-list 99 permit host [IP_address_of_polling_machine]

4. You must have the perl SNMP (UCD - I think) module

5.  You also need MRTG, RRDtool, Perl5+ etc etc

I run the script as `/path/to/pingnode.pl source dest comm` from within an
MRTG configuration file.

source is the target to ping from (can be IP address or host name)
dest is the target to ping to (can be IP address or host name)
commmunity is the read/write community string for the source

There are a few configuration items that can be tweaked in the script,
these are documented.

And let MRTG do the rest.


EG:
Options[_]: growright,transparent,gauge,nopercent
MaxBytes[_]: 1000
YLegend[_]: RTT & Packet Loss
ShortLegend[_]: ms
Legend1[_]: Round Trip Time in Milliseconds
Legend2[_]: Packet Loss as Percentage
LegendI[_]:   RTT:
LegendO[_]:  Loss:

Title[mel-bdr2.bal-cor1]: mel-bdr2 to bal-cor1
PageTop[mel-bdr2.bal-cor1]: <H1>Round Trip times (mel-bdr2 to
bal-cor1)</H1>
Target[mel-bdr2.bal-cor1]: `/opt/local/mrtg/bin/pingnode.pl mel-bdr2
bal-cor1 rw-string`
#


It returns four lines of output (as per the MRTG requirements), the first
is the average round trip time in milliseconds, the second is the
percentage packetloss, the third is the uptime in hundreths of a second,
and the last is the target name.  In my case this is source.dest.  You can
change this, but I don't think it matters

I have put these instructions together in a real hurry, so excuse me if
I've missed anything or been unclear.  The documentation is a little
sparse, so if anybody cares to improve on the code and/or documentation,
feel free.

Drop me an email if you have any problems/queries etc, and I'll be more
than happy to assist.

Regards,

Simon

> HI Simon,
> 
> I am very interested in seeing this. I have been waiting one to come up with
> one.
> 
> Can you tell me what commands are needed on the router if they are required?
> 
> Thanks
> 
> Steve
> 
> -----Original Message-----
> From: Simon Watts [mailto:swatts at connect.com.au]
> Sent: Wednesday, October 10, 2001 3:37 PM
> To: Tobias Oetiker
> Cc: Keith Olmstead; mrtg at list.ee.ethz.ch
> Subject: [mrtg] Re: Mesuring latency with MRTG 
> 
> 
> 
> 
> I have written a perl script that uses the Cisco ping MIB to collect round
> trip times and packet loss from point A, between point B and point
> C.  This data is then stored in a RRD.
> 
> The script is a very generic perl script, requiring only the SNMP module,
> and can be run using the external script option from within MRTG.  If you
> are interested in this, let me know, and I can send you copy.
> 
> Regards,
> 
> Simon 
> 
> On Tue, 9 Oct 2001, Tobias Oetiker wrote:
> 
> > 
> > Today Keith Olmstead wrote:
> > 
> > >
> > > Hello,
> > >
> > > Is there a script out there that I can measure latency between point A
> and
> > > point B. and then graph that data captured with MRTG+RRD+14all.cgi?
> > 
> > maybe my upcomming smokeping application could be for you ...
> > 
> > people.ee.ethz.ch/~oetiker/smokeping/smokeping.cgi
> > 
> > cheers
> > tobi
> > >
> > > --Keith
> > >
> > > --
> > > Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
> > > Archive     http://www.ee.ethz.ch/~slist/mrtg
> > > FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
> > > WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi
> > >
> > >
> > 
> > -- 
> >  ______    __   _
> > /_  __/_  / /  (_) Oetiker, ETZ J97, ETH, 8092 Zurich, Switzerland
> >  / // _ \/ _ \/ / phoneto:+41(0)1-632-5286  faxto:+41(0)1-632-1517
> > /_/ \.__/_.__/_/ mailto:oetiker at ee.ethz.ch
> http://people.ee.ethz.ch/~oetiker
> > 
> > 
> > --
> > Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
> > Archive     http://www.ee.ethz.ch/~slist/mrtg
> > FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
> > WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi
> > 
> > 
> 
> 
> ----------------------------------------------------------------
> Simon Watts            Assoc. Network Architect  9/114 Albert Rd
> swatts at connect.com.au  Ph  +61 3 9674 3890       South Melbourne
> Connect.com.au P/L     Fax +61 3 9251 3666       Vic, Aust, 3205 
> ----------------------------------------------------------------
> 
> 
> 
> --
> Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
> Archive     http://www.ee.ethz.ch/~slist/mrtg
> FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
> WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi
> 
> 
> ---
> This email and any files transmitted with it are solely intended for the use of the
> addressee(s) and may contain information that is confidential and privileged.  If you
> receive this email in error, please advise us by return email immediately.  Please also
> disregard the contents of the email, delete it and destroy any copies immediately.
> Computershare Limited and its subsidiaries do not accept liability for the views
> expressed in the email or for the consequences of any computer viruses that may be
> transmitted with this email
> 
> This email is also subject to copyright.  No part of it should be reproduced, adapted or 
> transmitted without the written consent of the copyright owner.
> 


----------------------------------------------------------------
Simon Watts            Assoc. Network Architect  9/114 Albert Rd
swatts at connect.com.au  Ph  +61 3 9674 3890       South Melbourne
Connect.com.au P/L     Fax +61 3 9251 3666       Vic, Aust, 3205 
----------------------------------------------------------------



-- Attached file removed by Listar and put at URL below --
-- Type: TEXT/PLAIN
-- Size: 6k (6268 bytes)
-- URL : http://www.ee.ethz.ch/~slist/pantomime/pingnode2.pl


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list