[Outages-discussion] mtr usage tips
Jeremy Chadwick
jdc at koitsu.org
Fri Mar 6 18:29:35 EST 2015
After some reports today, I thought I'd take a short moment to write up
something on mtr usage that might help some people, or shed light on
certain features or behaviours. This is for mtr 0.86, and I believe
some of these flags do not exist in older versions.
I tend to advocate use of the following flags:
-b --order=LSRNABW
Here's the explanation, so folks don't have to refer to the man page:
-b = Makes mtr show both IPs and hostnames. This is important because
FQDNs are often too long to fit within the column space (or if you want
just purely IPs, use -n instead). IPs are useful because they help NAs
know "where" to start looking, and the FQDNs can be potentially useful
because some providers have a common naming convention for geographic
location.
--order=LSRNABW = Displays the following fields, and in this order:
L = Packet loss % (ratio)
S = Packets sent
R = Packets received
N = Last RTT ("most recent" probe)
A = Average RTT
B = Best RTT
W = Worst RTT
The default order is LSNABWV (V = standard deviation, which is helpful
in some situations but not others; kinda like how J (jitter) is helpful
in some but not others), so the above adds "R" and removes "V".
The key two are "S" and "R". It's important to know how many samples
(packets) someone's mtr has attempted to send to each hop, combined with
how many were (or weren't) received (it saves people from having to do
the math themselves ("how many packets of 276 is 3.7%?")).
How this is helpful: if someone provides an mtr that shows 10% loss at
the destination, but only let the mtr run for 10 seconds (10 probes),
that isn't nearly as helpful or definitive as if someone ran it for 500
seconds and saw the same 10% loss.
You can use the MTR_OPTIONS environment variable to set default flags
(e.g. export MTR_OPTIONS="-b --order=LSRNABW").
And finally, one about limiting mtr output width without resizing your
terminal window:
mtr by default uses the entire width of your terminal window. It uses
ncurses, which means the COLUMNS environment variable can be used to
limit the width without having to resize your terminal window (e.g.
COLUMNS=60 mtr 8.8.8.8).
How this is helpful: if you use an Email client that wraps text at a
specific column (like I do), manually cleaning this up becomes tedious
and it's easy to mess up whitespace/alignment; COLUMNS helps greatly.
What I've used for years is the following (with a 132x43 terminal):
alias mtr="COLUMNS=110 mtr -b --order=LSRNABW"
But commonly I may do something like this:
COLUMNS=75 \mtr 4.2.2.1
The \ in front of mtr causes the shell to ignore any aliases, allowing
me to run "stock mtr" in whatever manner I wish, with whatever flags I
wish (that's why I personally don't use MTR_OPTIONS; \mtr wouldn't
inhibit use of that environment variable).
--
| Jeremy Chadwick jdc at koitsu.org |
| UNIX Systems Administrator http://jdc.koitsu.org/ |
| Making life hard for others since 1977. PGP 4BD6C0CB |
On Fri, Mar 06, 2015 at 09:14:26PM +0000, Garbacz, Joseph via Outages wrote:
> The destination has 0(zero) loss, what you are pointing out is hops prior to the destination showing loss. Most likely what you are seeing is some sort of ICMP deprioritization, which is a standard practice for many isp.
>
> From: Outages [mailto:outages-bounces at outages.org] On Behalf Of Ivan Kovacevic via Outages
> Sent: Friday, March 6, 2015 3:43 PM
> To: outages at outages.org<mailto:outages at outages.org>
> Subject: [outages] gtt.net issues in NYC?
>
> Pinging from Toronto Canada:
>
> Host Loss% Last Avg Best Wrst StDev
> 1. X.X.X.X 0.0% 2.5 11.0 0.5 99.2 11.3
> 2. X.X.X.X 0.0% 0.5 7.6 0.4 313.9 37.5
> 3. X.X.X.X 0.0% 0.5 4.5 0.4 126.9 18.0
> 4. ae1-128.tor10.ip4.gtt.net<http://ae1-128.tor10.ip4.gtt.net> 0.0% 0.3 3.2 0.2 63.5 10.6
> 5. xe-10-3-6.nyc41.ip4.gtt.net<http://xe-10-3-6.nyc41.ip4.gtt.net> 0.0% 22.1 21.7 16.3 27.1 2.2
> 6. nobis-gw.ip4.gtt.net<http://nobis-gw.ip4.gtt.net> 3.8% 29.8 25.4 18.1 35.9 4.1
> 7. 23.105.128.30.rdns.as15003.net<http://23.105.128.30.rdns.as15003.net> 1.9% 23.6 23.1 18.2 47.3 3.3
> 8. 173.234.233.242.rdns.ubiquityservers.co<http://173.234.233.242.rdns.ubiquityservers.co> 0.0% 14.8 15.0 14.1 18.6 0.9
>
>
>
> Best Regards,
>
> Ivan Kovacevic
> Vice President, Client Services
> Star Telecom | www.startelecom.ca<http://www.startelecom.ca/> | SIP Based Services for Contact Centers
>
> _______________________________________________
> Outages mailing list
> Outages at outages.org
> https://puck.nether.net/mailman/listinfo/outages
> _______________________________________________
> Outages mailing list
> Outages at outages.org
> https://puck.nether.net/mailman/listinfo/outages
More information about the Outages-discussion
mailing list