Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Install mtr, a replacement for traceroute UNIX
My home setup runs behind a Linksys WAN router. I've never had any luck getting the traceroute command to work from behind this router, despite reading the various hints and suggestions on the web.

The other day, while researching the problem yet again, I ran across a reference to Matt's traceroute ("MTR"), which claims to combine the features of traceroute and ping. In one of the threads I was reading, someone claimed that it worked in situations where traceroute did not. I thought I'd give it a shot, so I downloaded the 0.51 source [86K download] and expanded the archive.

I successfully compiled the program by simply typing:
 % cd /path/to/mtr-0.51/
% ./configure --bindir=/usr/local/bin
--mandir=/usr/local/share/man
% make
% sudo make install
% rehash
The whole process took about two minutes, and when it was done, I had a useful tool that worked just fine from behind my Linksys. By combining ping and traceroute, you get a real-time output that shows exactly where the hang-ups in a given connection may be. There are also a number of output display options (press "D" to cycle between them), and mtr includes a very good 'man' page as well. It seems like a good tool to me, and it (finally!) gives me back my traceroute abilities.

[Editor's note: Hey, wait, I don't need an editor's note! I actually wrote this one! See, I do know how to use OS X! ;-)]


Panther broken!
    •    
  • Currently 3.33 / 5
  You rated: 4 / 5 (3 votes cast)
 
[23,107 views]  

Install mtr, a replacement for traceroute | 25 comments | Create New Account
Click here to return to the 'Install mtr, a replacement for traceroute' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Flag to traceroute
Authored by: Pi_ on Nov 21, '02 11:27:55AM

I used a linux box behind a links**t firewall, and you had to pass the -I flag to traceroute to make it work.

Pi



[ Reply to This | # ]
Update firmware
Authored by: jwigdahl on Nov 21, '02 12:35:33PM

Or just update your router to the latest firmware.

ftp://ftp.linksys.com/pub/befsr41/befsr-fw-1433.zip



[ Reply to This | # ]
Update firmware
Authored by: Pi_ on Nov 21, '02 01:37:08PM

Well, the box is now it's own firewall, because the owner just hubbed a line off of his cable modem and gave his parents the links**t.



[ Reply to This | # ]
Update firmware
Authored by: gteague on Nov 21, '02 03:29:20PM

when i went to update my linksys wireless router ?be4sw11? (which i had purchased when they first came out), i found that this latest firmware update v1.4.3x only works with version 2 of the router and those of us with version one are stranded with the 1.4.2x firmware. not that i'm complaining, i've gotten good service from this router and it still works just fine.

i've used mtr on linux before and it is a good network tool.

/guy



[ Reply to This | # ]
I installed it (i think) but it does not work.
Authored by: skitch2310 on Nov 21, '02 12:49:35PM

i followed your steps. I get the MAN page but when i type in a command nothing happens "command not found". do you just type "mtr"?



[ Reply to This | # ]
Re: I installed it (i think) but it does not work.
Authored by: jbelog on Nov 21, '02 01:31:30PM

You'll need to have /usr/local/bin in your path in your manpath. If they are (echo $PATH to check), just type rehash at the cli to pick up the new commands. If you don't have the paths, add them to your .tschrc file.

To check to see if it's working with out having them in your path, enter the full path at the cli:

>/usr/local/bin/mtr

Good luck,
__jbelog



[ Reply to This | # ]
I installed it (i think) but it does not work.
Authored by: muller on Nov 21, '02 02:07:19PM

If you didn't specify /usr/local/bin in the configure process the install directory that it used defaults to /usr/local/sbin which is not in the tcsh path by default. All you should need to do is:
sudo mv /usr/local/sbin/mtr /usr/local/bin/mtr
rehash

that should do it.



[ Reply to This | # ]
I installed it (i think) but it does not work.
Authored by: skitch2310 on Nov 21, '02 02:23:14PM

sweet ! Thank you, that did the trick



[ Reply to This | # ]
I installed it (i think) but it does not work.
Authored by: david-bo on Nov 26, '02 09:24:32AM

I did specify /usr/local/bin to configure but mtr still ended up in /usr/local/sbin?

This is how I run ./configure

% ./configure --bindir=/usr/local/bin --mandir=/usr/local/share/man

And this is how the beginning of the Makefile looks:

SHELL = /bin/sh

srcdir = .
top_srcdir = .
prefix = /usr/local
exec_prefix = ${prefix}

bindir = /usr/local/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datadir = ${prefix}/share
sysconfdir = ${prefix}/etc
sharedstatedir = ${prefix}/com
localstatedir = ${prefix}/var
libdir = ${exec_prefix}/lib
infodir = ${prefix}/info
mandir = /usr/local/share/man
includedir = ${prefix}/include
oldincludedir = /usr/include

DESTDIR =

pkgdatadir = $(datadir)/mtr
pkglibdir = $(libdir)/mtr
pkgincludedir = $(includedir)/mtr

top_builddir = .

ACLOCAL = aclocal
AUTOCONF = autoconf
AUTOMAKE = automake
AUTOHEADER = autoheader

INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL} $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
transform = s,x,x,

NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
CC = gcc
CURSES_OBJ = curses.o
GTK_CFLAGS =
GTK_CONFIG = no
GTK_LIBS =
GTK_OBJ =
MAKEINFO = makeinfo
PACKAGE = mtr
POST_UNINSTALL = :
CC = gcc
CURSES_OBJ = curses.o
GTK_CFLAGS =
GTK_CONFIG = no
GTK_LIBS =
GTK_OBJ =
MAKEINFO = makeinfo
PACKAGE = mtr
VERSION = 0.51

SUBDIRS = img

sbin_PROGRAMS = mtr
man_MANS = mtr.8


Really does not matter, /usr/locar/sbin was in my path as well, jut curious why this happened. Ideas?



[ Reply to This | # ]
traceroute fixed
Authored by: StevenRiggins on Nov 21, '02 01:37:07PM

The latest linksys router firmware from a few days ago fixes the traceroute from LAN problem. :)



[ Reply to This | # ]
Check out lft
Authored by: ComputerX on Nov 21, '02 01:42:35PM

I love mtr. One of the first things I install.

You might want to take a look at lft <http://www.macupdate.com/info.php/id/9758>

It is pretty nice too. Does different things. They make a nice pair.

Does anyone know how to traceroute through an AirPort from OS9? I have a client complaining about slow internet access. I would like to show him how to traceroute, but he only connects through AirPort (no wires to his desk.) WhatRoute doesn't go.

Sorry if this is basic. I haven't spent more than 5 minutes on getting it to work. I'm trying to get the AirPorts replaced with something more robust.

Thanks,

Dan



[ Reply to This | # ]
doesn't run on OS X 10.2?
Authored by: wealthychef on Nov 21, '02 02:55:37PM

I did a
./configure
sudo make install
all seemed to go well, but when I type mtr it complains:
[richcookmac:~] rcook% mtr localhost
dyld: mtr Undefined symbols:
mtr undefined reference to _stdscr expected to be defined in /usr/lib/libSystem.B.dylib
Trace/BPT trap

? whasup?



[ Reply to This | # ]
Runs fine on 10.2.2...
Authored by: robg on Nov 21, '02 03:34:18PM

Did you forget the "make" step? It's not listed in your post...

-rob.



[ Reply to This | # ]
doesn't run on OS X 10.2?
Authored by: aisikl on Nov 22, '02 07:41:44AM

I'm a bit surprised that compiling mtr worked for almost everyone here without errors because i had the same errors as wealthychef BUT there's a really simple fix for it -- do as follows:
after gunzipping the file and BEFORE typing ./configure, go into the mtr folder and look for a file called curses.c -- open it with a text editor and scroll down till you find the following lines:

#ifndef getmaxyx
# define getmaxyx(win,y,x) ((y) = (win)->_maxy + 1, (x) = (win)->_maxx + 1
#endif

just delete the underscores before maxy and maxx so that the lines look like:

#ifndef getmaxyx
# define getmaxyx(win,y,x) ((y) = (win)->maxy + 1, (x) = (win)->maxx + 1
#endif

save your changes and run ./configure, make, and install.
that's all.
good luck



[ Reply to This | # ]
doesn't run on OS X 10.2?
Authored by: blip on Jan 12, '03 08:29:01AM

The fix of removing underscores in the curses.c file did not work for me. I got the same error as WealthyChef -
dyld: mtr Undefined symbols:
mtr undefined reference to _stdscr expected to be defined in /usr/lib/libSystem.B.dylib
Trace/BPT trap
Any other possible solutions?



[ Reply to This | # ]
Running mtr
Authored by: slord on Nov 22, '02 02:38:59AM
To get mtr up and running FAST. Here is a quick start guide: (1) unpack (2) go into mtr directory (3) type ./configure (4) when 3 is done, type make (5) when 4 is done, type make install (6) when 5 is done mtr is installed (7) Now to run it type sudo ./mtr apple.com and hit return (8) you will be asked for your root password because we are calling "sudo" Then just watch the numbers fly!

[ Reply to This | # ]
RDNS Problem?
Authored by: below on Nov 23, '02 11:55:11AM

On my system -- using a DrayTek 2600W+ router -- mtr only gives me the numbers of the hosts en-route, not the names as it should. Any idea what I need to configure to get the names of the hosts?

Thanks,

Alex



[ Reply to This | # ]
mtr traceroute won't install
Authored by: blip on Jan 09, '03 08:16:41PM

I had been using mtr under 10.15. I recently switched to 10.2.3 and it broke -'dyld: mtr Undefined symbols:
mtr undefined reference to _stdscr expected to be defined in /usr/lib/libSystem.B.dylib
Trace/BPT trap'

I then used the prescription mentioned in the Hints for a new download and install. But it bombs after a few seconds after invoking the ./configure in the mtr folder:

:/Applications/mtr-0.51] blip% ./configure --bindir=/usr/local/bin \
--mandir=/usr/local/share/man
creating cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... no
checking for working aclocal... found
checking for working autoconf... missing
checking for working automake... found
checking for working autoheader... missing
checking for working makeinfo... found
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH


This takes all of 5 seconds. If I proceed with the rest of the recipe then 'make' is not recognizable as a command. Any thoughts what I am doing wrong?

Thanks,

BLip



[ Reply to This | # ]
mtr traceroute won't install
Authored by: wolfy on Jan 10, '03 12:14:35AM

Looks to me like you don't have the Developer Tools installed, or if you do, you don't have /usr/bin in your $PATH.



[ Reply to This | # ]
mtr traceroute won't install
Authored by: blip on Jan 10, '03 10:36:09AM

Thanks very much. You got me going but I want to mention the following problems:

1) After installing the developer's tools I was able to run the .config. There was an error checking for GTK - version >= 1.0.0... no
*** Could not run GTK test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GTK was incorrectly installed
*** or that you have moved GTK since it was installed. In the latter case, you
*** may want to edit the gtk-config script: /sw/bin/gtk-config

However it seemed to finish and so I went ahead and tried a 'make'. The terminal could not find the command so I looked for it. Found it in /usr/bin but as an alias -
lrwxr-xr-x 1 root wheel 7 Jan 10 09:47 make -> gnumake
My path did include /usr/bin so I explicitly ran it from its directory and the make proceeded (gnumake works without explicitly specifying the directory).

2. I then tried to run mtr and that was not to be found. I looked for that as well. Apparently it was in /usr/local/sbin which was NOT in my path. I redefined the PATH and now I can run mtr ok. The 'man' for mtr was not a problem.

After getting past installation of the developer's tools it still too some delving to get things going. Is there an obvious reason or I am I just too much of a novice?

I should mention my friend Chris played a big role in guiding me through this.

Thanks again,

BLip



[ Reply to This | # ]
mtr traceroute won't install
Authored by: wolfy on Jan 10, '03 09:43:09PM

I don't recall having any problems with the install, and certainly nothing with gtk. It's possible you've got some sort of problem with the gtk installation in Fink, so a reinstall might be appropriate before you try to do any additional compiles on your own.

The link from make to gnumake is standard I believe.

I do remember having mtr dumped into /usr/local/sbin, and having to add that to my PATH. Not a big deal that - just mtr installing someplace that isn't standard under OS X.



[ Reply to This | # ]
mtr traceroute won't install
Authored by: blip on Jan 12, '03 09:17:27AM

Hi,
I did a find on 'gtk' on my machine and found the following:
/sw/etc/gtk
/sw/include/gtk-1.2/gtk
/sw/share/themes/Default/gtk
/sw/share/doc/gtk+

So, I have some aspect of gtk. Are you recommending redownloading fink, or just using fink (dselect) to acquire gtk?

Also, I installed mtr on my home computer after installing the devlopers tools. ./configure appeared to work as it did for me before (with the same gtk error) but then I get the same error as 'wealthchef' above:
dyld: mtr Undefined symbols:
mtr undefined reference to _stdscr expected to be defined in /usr/lib/libSystem.B.dylib
Trace/BPT trap

I did the fix recommended by removing the underscores n the curses.c file and reinstalled mtr. This did not fix it. Do you have any advice in this area? In searching the web it appears that this is related to the fact that I have upgraded from 10.1 to 10.2 and that the binary file is looking for _stdscr in libSystem.B.dylib instead of libcurses.dylib. I need to modify the binary? But which of the many mtr files is that?

Thanks again,

Bruce



[ Reply to This | # ]
mtr traceroute won't install
Authored by: marmoset on Jan 12, '03 10:31:33AM

You can always just do a 'fink rebuild mtr', which will recompile mtr against current libraries, which will sometimes fix quirky issues with programs you built under an older OSX version.



[ Reply to This | # ]
compile under Panther
Authored by: LouieNet on Sep 20, '05 02:22:45AM
Go to the end of this other hint to get instructions on how to compile mtr under Panther. (I normally use fink to install my software, but I didn't want to open up the unstable tree for just this one program.)

Louie

---
G4 cube, 17" Powerbook G4, iMac 20", Mac mini, PowerMac 7500 (w/ G4 upgrade card)

[ Reply to This | # ]

Install mtr, a replacement for traceroute
Authored by: timhaigh on Apr 05, '09 06:44:58PM
anyone wanting a precompiled installer of the latest mtr for leopard. I made on and you can get it here http://planetmac.co.uk/downloads

[ Reply to This | # ]