Giter Site home page Giter Site logo

traviscross / mtr Goto Github PK

View Code? Open in Web Editor NEW
2.5K 99.0 330.0 1.45 MB

Official repository for mtr, a network diagnostic tool

Home Page: http://www.bitwizard.nl/mtr/

License: GNU General Public License v2.0

C 79.43% Shell 1.73% Makefile 0.81% M4 1.62% Batchfile 0.23% C++ 4.96% Python 11.20% Emacs Lisp 0.02%

mtr's Introduction

WHAT IS MTR?

mtr combines the functionality of the 'traceroute' and 'ping' programs in a single network diagnostic tool.

As mtr starts, it investigates the network connection between the host mtr runs on and a user-specified destination host. After it determines the address of each network hop between the machines, it sends a sequence of ICMP ECHO requests to each one to determine the quality of the link to each machine. As it does this, it prints running statistics about each machine.

mtr is distributed under the GNU General Public License version 2. See the COPYING file for details.

INSTALLING

If you're building this from a tarball, compiling mtr is as simple as:

./configure && make

Please note that this refers to the tarballs from https://www.bitwizard.nl/mtr/files/ and not the tarballs that github can produce.

(in the past, there was a Makefile in the distribution that did the ./configure for you and then ran make again with the generated Makefile, but this has suffered some bitrot. It didn't work well with git.)

If you're building from the git repository, you'll need to run:

./bootstrap.sh && ./configure && make

When it looks as if the compilation was successful, you can test mtr with

sudo ./mtr <host>

(fill in a hostname or IP address where it says ) or immediately continue on to installing:

make install

Note that mtr-packet must be suid-root because it requires access to raw IP sockets. See SECURITY for security information.

Older versions used to require a non-existent path to GTK for a correct build of a non-gtk version while GTK was installed. This is no longer necessary. ./configure --without-gtk should now work. If it doesn't, try make WITHOUT_X11=YES as the make step.

On Solaris, you'll need to use GNU make to build. (Use gmake rather than make.)

On Solaris (and possibly other systems) the "gtk" library may be installed in a directory where the dynamic linker refuses to look when a binary is setuid. Roman Shterenzon reports that adding -Wl,-rpath=/usr/lib to the commandline will work if you are using gnu LD. He tells me that you're out of luck when you use the sun LD. That's not quite true, as you can move the gtk libraries to /usr/lib instead of leaving them in /usr/local/lib. (when the ld tells you that /usr/local/lib is untrusted and /usr/lib is trusted, and you trust the gtk libs enough to want them in a setuid program, then there is something to say for moving them to the "trusted" directory.)

Building on MacOS should not require any special steps.

USING MTR ON WINDOWS

Using mtr on Windows requires Windows Subsystem for Linux (WSL).
To install WSL with Ubuntu distribution (Default), see How to install Linux on Windows with WSL.

After complete initial process, simple as:

sudo apt-get -y install mtr

BUILDING FOR WINDOWS (TRADITIONAL METHOD)

If you prefer traditional method. Obtain Cygwin, see https://cygwin.com/install.html.

Next, re-run cygwin's setup-x86.exe (or setup-x86_64.exe if you're using 64bit cygwin) with the following arguments,

which will install the packages required for building:

    setup-x86.exe --package-manager --wait --packages automake,pkg-config,make,gcc-core,libncurses-devel,libjansson-devel

Build as under Unix:

    ./bootstrap.sh && ./configure && make

Finally, install the built binaries:

    make install

WHERE CAN I GET THE LATEST VERSION OR MORE INFORMATION?

mtr is now hosted on github. https://github.com/traviscross/mtr

See the mtr web page at http://www.BitWizard.nl/mtr/

Bug reports and feature requests should be submitted to the Github bug tracking system.

Patches can be submitted by cloning the Github repository and issuing a pull request, or by email to me. Please use unified diffs. Usually the diff is sort of messy, so please check that the diff is clean and doesn't contain too much of your local stuff (for example, I don't want/need the "configure" script that /your/ automake made for you).

(There used to be a mailinglist, but all it got was spam. So when the server was upgraded, the mailing list died.)

REW

mtr's People

Contributors

23hiro avatar a1346054 avatar aquerubin avatar atibdialpad avatar flu0r1ne avatar garethrandall avatar hloeung avatar jbruggeman avatar jwilk avatar kasper93 avatar kerolasa avatar krisl avatar linghutiantian avatar mackyle avatar matt-kimball avatar meingtsla avatar msekletar avatar narthorn avatar rewolff avatar richih avatar rpaaron avatar rpwoodbu avatar saintbol avatar slord399 avatar swordfeng avatar traviscross avatar trittweiler avatar vbajpai avatar vincentbernat avatar weiyixuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mtr's Issues

TCP SYN. What exactly is being measured?

Hi,

Trying to debug some weird network issue I've found that I'm unable to read mtr output while using --tcp param.

There are two hosts, sitting on the same switch. Here is what I've got with mtr:

mtr -c 10 -n -T -4 --port 80 1.1.1.1 --report
Start: Mon Oct 19 13:59:09 2015
HOST: XXX Loss% Snt Last Avg Best Wrst StDev
1.|-- 1.1.1.1 10.0% 10 2002. 1690. 200.6 2002. 649.7

Using other utils, like nc, hping, tcptraceroute I'm getting 'normal' values, same as mtr shows in icmp mode.

Please help to understand whats exactly is being measured by mtr in --tcp mode?

mtr -v
mtr 0.85

Thank you!

Color is gone

Every version of MTR I have compiled to run on Mac OS X appears to reflect the colour scheme of my bash profile and my terminal settings.

version 0.85 looks good with a view that is pleasing to the eye. as soon as I upgraded MTR to version 0.86 all i get is a grey and black monochrome output.

no Keypress detection during split or raw modes

Hello,
reading the source code (select.c display.c and split.c)
I can see some keypress functions but they doesn't work,
inside select.c at line 183 the switch block is never tested,
the surrounding if is always FALSE...
I tried it on FreeBSD and Linux putting some printf.
any ideas to further investigate the key press events?
thank you

#include <sys/filio.h> required on Solaris/illumos

Hi There,

On our SmartOS system (An illumos distribution, where illumos is the open source fork of the now closed OpenSolaris distribution), when compiling mtr we see the following:

/ec/bin/gcc -DHAVE_CONFIG_H -I. -m32 -O3 -I/ec/include -Wall -Wno-pointer-sign -MT net.o -MD -MP -MF .deps/net.Tpo -c -o net.o /home/build/ec-userland/components/mtr/source/mtr-0.85/net.c /home/build/ec-userland/components/mtr/source/mtr-0.85/net.c: In function 'net_send_tcp': /home/build/ec-userland/components/mtr/source/mtr-0.85/net.c:354: error: 'FIONBIO' undeclared (first use in this function) /home/build/ec-userland/components/mtr/source/mtr-0.85/net.c:354: error: (Each undeclared identifier is reported only once /home/build/ec-userland/components/mtr/source/mtr-0.85/net.c:354: error: for each function it appears in.) make[3]: *** [net.o] Error 1

On my system fixing this simply required including sys/filio.h, a la:

--- mtr-0.85/net.c.orig 2013-10-25 11:39:27.394287959 +0000
+++ mtr-0.85/net.c      2013-10-25 11:41:25.111708965 +0000
@@ -27,6 +27,7 @@
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <sys/select.h>
+#include <sys/filio.h>
 #include <netinet/in.h>
 #include <memory.h>
 #include <unistd.h>
@@ -1562,4 +1563,4 @@
   net_add_fds(&writefd, &maxfd);
   select(maxfd, NULL, &writefd, NULL, &tv);
   net_process_fds(&writefd);
-}
\ No newline at end of file
+}

Obviously since this doesn't exist on non-Solaris systems, an #ifdef __sun is probably needed too (or other autoconf magic).

Thanks!

Alasdair

Feature Request: New display mode inspired by gping

gping has an useful graphical display for ping data:

image

I would love an additional display mode for mtr that allowed switching among a set of gping-like graphs for each hop with 🔼 & 🔽 (bolding or otherwise highlighting the hop currently being graphed).

/CC @orf

mtr-0.85 fails to build with musl libc

Build with musl libc fails during configure with:

...
checking for getaddrinfo... yes
checking whether __res_state_ext needs to be defined... yes
checking whether provided __res_state_ext definition can be compiled... no
configure: error: Need definition for struct __res_state_ext but unable to define it.

config.log: gives those details:

configure:5575: checking whether provided __res_state_ext definition can be comp
iled
configure:5612: gcc -c -g -O2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz    conftest.c >&5
conftest.c:46:27: error: array type has incomplete element type
  union res_sockaddr_union nsaddrs[MAXNS];
                           ^
conftest.c: In function 'main':
conftest.c:44:34: error: 'struct <anonymous>' has no member named 'ext'
 #define RESEXTIN6(r,i) (r._u._ext.ext->nsaddrs[i].sin6)
                                  ^
conftest.c:64:8: note: in expansion of macro 'RESEXTIN6'
 return RESEXTIN6(res,0).sin6_addr.s6_addr[0];
        ^
configure:5612: $? = 1

'IPINFO' is defined here; did you mean 'NO_IPINFO'? // OSX 10.10 Yosemite

Making all in img
make[2]: Nothing to be done for `all'.
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -DHAVE_CONFIG_H -I. -g -O2 -Wall -Wno-pointer-sign -MT mtr.o -MD -MP -MF .deps/mtr.Tpo -c -o mtr.o mtr.c
In file included from mtr.c:46:
./asn.h:27:9: warning: 'NO_IPINFO' is used as a header guard here, followed by
#define of a different macro [-Wheader-guard]

ifndef NO_IPINFO

    ^~~~~~~~~

./asn.h:28:9: note: 'IPINFO' is defined here; did you mean 'NO_IPINFO'?

define IPINFO

    ^~~~~~
    NO_IPINFO

1 warning generated.
mv -f .deps/mtr.Tpo .deps/mtr.Po
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -DHAVE_CONFIG_H -I. -g -O2 -Wall -Wno-pointer-sign -MT report.o -MD -MP -MF .deps/report.Tpo -c -o report.o report.c
In file included from report.c:35:
./asn.h:27:9: warning: 'NO_IPINFO' is used as a header guard here, followed by
#define of a different macro [-Wheader-guard]

ifndef NO_IPINFO

    ^~~~~~~~~

./asn.h:28:9: note: 'IPINFO' is defined here; did you mean 'NO_IPINFO'?

define IPINFO

    ^~~~~~
    NO_IPINFO

1 warning generated.
mv -f .deps/report.Tpo .deps/report.Po
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -DHAVE_CONFIG_H -I. -g -O2 -Wall -Wno-pointer-sign -MT curses.o -MD -MP -MF .deps/curses.Tpo -c -o curses.o curses.c
In file included from curses.c:66:
./asn.h:27:9: warning: 'NO_IPINFO' is used as a header guard here, followed by
#define of a different macro [-Wheader-guard]

ifndef NO_IPINFO

    ^~~~~~~~~

./asn.h:28:9: note: 'IPINFO' is defined here; did you mean 'NO_IPINFO'?

define IPINFO

    ^~~~~~
    NO_IPINFO

1 warning generated.
mv -f .deps/curses.Tpo .deps/curses.Po
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -g -O2 -Wall -Wno-pointer-sign curses.o -o mtr mtr.o net.o dns.o raw.o split.o display.o report.o getopt.o getopt1.o select.o asn.o -lresolv -lm -lncurses

cygwin 32 bit

Could it be that on Cygwin mtr: unable to get raw sockets. means mtr cannot run on Windows?

mtr built with ipv6 enabled doesn't work in ipv4 only env

mtr (tested 0.84/0.85) fails if it was built with ipv6 support on a machine with ipv4 only availability:

mtr 12.12.12.12:

16870 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 5
16870 socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = -1 EAFNOSUPPORT (Address family not supported by protocol)
16870 write(2, "Unable to allocate IPv6 socket for nameserver communication: Address family not supported by protocol\n", 102) = 10216870
exit_group(-1) = ?

It should check if ipv6 socket can be created and avoid using it if not (unless -6 was specified where it should fail in such case)

mtr 0.85 crash when using tcp mode

Steps to reproduce:

# mtr -i0.01 -T 8.8.8.8

It crashed in about a second (SIGABRT).

Backtrace:

(gdb) bt
#0  0x00007f471e2df1c9 in raise () from /usr/lib/libc.so.6
#1  0x00007f471e2e05c8 in abort () from /usr/lib/libc.so.6
#2  0x00007f471e31d037 in __libc_message () from /usr/lib/libc.so.6
#3  0x00007f471e3a4e67 in __fortify_fail () from /usr/lib/libc.so.6
#4  0x00007f471e3a3070 in __chk_fail () from /usr/lib/libc.so.6
#5  0x00007f471e3a4dd7 in __fdelt_warn () from /usr/lib/libc.so.6
#6  0x000000000040786c in net_process_fds ()
#7  0x000000000040bae5 in select_loop ()
#8  0x0000000000402b7b in main ()

OS is Arch Linux x86_64, with glibc 2.17

use of ncurses on Solaris leads to linker warnings

When building on Solaris (this is S12 development bits, but should include production S11 bits), configure finds tgetent() in libtermcap:

checking for tgetent in -ltermcap... yes

but when we get to linking, we get a couple of undefined symbols:

cc  -m64 -xO4 -xchip=generic -Ui386 -U__i386 -xregs=no%frameptr    -mt  curses.o -m64 -o mtr mtr.o net.o dns.o raw.o split.o display.o report.o getopt.o getopt1.o select.o    -lresolv -lm -ltermcap 
Undefined                       first referenced
 symbol                             in file
wattr_on                            curses.o
wattr_off                           curses.o
ld: fatal: symbol referencing errors

This seems to be because we're explicitly using the ncurses headers. Forcing configure to look at ncurses before termcap for tgetent() makes it all work (since the use of ncurses is what I want here, anyway).

However, then we get a warning from the linker:

ld: warning: symbol 'timeout' has differing types:
    (file mtr.o type=OBJT; file /usr/lib/64/libncurses.so type=FUNC);
    mtr.o definition taken

which seems to indicate that it did the right thing, but the warning is distressing nevertheless. Patching mtr.c and net.c to use a different name instead of "timeout" (I chose "tcp_timeout") makes the warning go away. The one Linux system I have access to at the moment doesn't have any symbols in its ncurses library, so I can't check whether this is at all a problem there.

mtr-0.85 tarball shouldn't contain object files

Dist tarball for mtr-0.85 located at [1] does contain compiled object files. This prevents building mtr for other arches than x86_64 from pristine upstream source. Such binary blobs shouldn't be included in dist tarball. AFAIKT, build-system works correctly and issuing make dist command creates gzipped tarball without object files. It looks like this won't happen again, but it would be nice to regenerate and reupload correct tarball at the ftp site.

[1] ftp://ftp.bitwizard.nl/mtr/mtr-0.85.tar.gz

Cheers,

Michal

default hostname 'localhost' does not work :(

When mtr is invoked either from CLI or GUI menu item, the default hostname 'localhost' does not have any effect and the mtr 0.85 aborts without giving out any message or reason :(

How to repeat:
Invoke mtr from CLI or any GUI

What is expected:
It must start traceroute and ping to 'localhost'

What's wrong:
mtr aborts, no reason and, or message is displayed.

mtr-0.85.tar.gz missing .Deps folder

Hi There,

I think the release script that checks out from github is failing to include hidden directories as the .Deps directory was missing. This necessitated me checking out directly from github (and made building the latest mtr from our build system a little bit trickier!).

Thanks,

Alasdair

Can mtr not change background color to black?

After a recent update, mtr (curses ui) changes the screen background color to black, rather than leave it untouched. I use a dark gray background color and I don't like full black.

I use git bisect to know that this change was done in f2bc4aa. It says it makes the display colorful. I switch display modes and see some colors. It's nice! But is there an easy way to support colors without overriding the background color? (I know Vim can do that.)

No output on interrupting a --report with ^C

When you're doing a long run with --report, and decide to interrupt the process with ^C, it would be nice if mtr would dump the output as it has, instead of simply quitting and abandoning the whole run.

mtr --report sometimes missing some pings

Sometimes when I run mtr --report I see the last hops missing one ping. It even seems to miss the receipt of the last ping and displays a loss which isn't real.

Example output (the data was anonymized):

HOST: myhostname                  Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- 1.3.102.66                 0.0%    10    0.2   0.2   0.2   0.3   0.0
  2.|-- 2.21.153.193               0.0%    10    1.0   1.0   0.9   1.2   0.0
  3.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
  4.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
  5.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
  6.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
  7.|-- 1.2.64.145                 0.0%    10    6.3   7.7   6.0  10.1   1.8
  8.|-- 1.6.149.210               80.0%    10   11.9  13.1  11.9  14.3   1.4
  9.|-- 1.6.63.174                 0.0%    10   11.3  11.0  10.0  13.4   0.9
 10.|-- 25.54.28.110               0.0%    10   96.4  97.0  96.4  98.4   0.3
 11.|-- 23.117.3.58                0.0%    10  110.3 110.9 110.3 111.7   0.0
 12.|-- 23.117.50.158              0.0%    10  105.7 105.1 104.6 105.7   0.0
 13.|-- 93.8.25.122                0.0%     9  114.3 114.1 113.6 114.7   0.0
 14.|-- 293.8.25.3                11.1%     9  111.0 110.8 110.1 112.2   0.4

Errors (stderr) overwrite Keys: menu

Error messages overwrite the Keys: menu, it seems these messages are output via stderr on Linux. For example the normal:

Keys:  Help   Display mode   Restart statistics   Order of fields   quit

is replaced with

Resolver: Received error response 2. (server failure)er of fields   quit

If I start mtr as "mtr host 2>/dev/null" then the errors are ignored.

Ideally errors would be displayed somewhere to not interfere with the standard output.

Busy loop in pause mode

Reported at the Debian BTS by Moritz Hoffmann at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637546 . All credits to him. Verified in 0.85


mtr has an undocumented option in curses mode that pauses mtr. Simply
press 'p' and the process will stop until space is pressed. However, it
does not wait for input but rather calls select repeatedly to wait for
an event. Due to the select parameters, select returns immediately such
that mtr constantly loops.

The problem is in select.c. However, I don't know what the best patch
for this is. The following patch just increases the timeout so that the
mtr does not spin that fast.

--- mtr-0.80.orig/select.c
+++ mtr-0.80/select.c
@@ -84,8 +84,8 @@
     do {
       if(anyset || paused) {
        selecttime.tv_sec = 0;
-       selecttime.tv_usec = 0;
-
+       selecttime.tv_usec = 200;
+
        rv = select(maxfd, (void *)&readfd, NULL, NULL, &selecttime);

       } else {

MPLS information no longer appears in --report | -r mode

I've noticed that when run in -r | --report mode, MTR 0.86 does not include the MPLS information. The previous version I used (0.82) included the MPLS info in report mode. Example output from both versions is below.

Just wondering if this change was by design or a bug?

Thank you for your time and effort publishing MTR.

This is what the 0.86 output looks like...

[root@server bin]# ./mtr-0.86 -n --psize 1360 -r -e -c 5 97.88.218.225
Start: Mon Jul 13 09:12:52 2015
HOST: server               Loss%   Snt   Last   Avg  Best  Wrst StDev
1.|-- 10.22.1.2          0.0%     5    0.6   0.5   0.3   0.7   0.0
2.|-- ???                100.0    5    0.0   0.0   0.0   0.0   0.0
3.|-- 161.8.134.45       0.0%     5    1.4   2.3   1.2   5.5   1.7
4.|-- 67.10.26.137       0.0%     5   20.6  11.5   6.5  20.6   6.5
5.|-- 67.14.211.18       0.0%     5   18.8  19.8  17.9  26.1   3.5
6.|-- 64.146.26.186      0.0%     5   17.6  19.8  17.6  28.5   4.8
7.|-- 27.88.4.238        0.0%     5   39.2  42.2  38.8  49.2   4.2
8.|-- 27.88.2.28         0.0%     5   45.6  51.7  45.6  72.2  11.5
9.|-- 26.156.1.13        0.0%     5   38.8  39.1  38.8  39.7   0.0
10.|-- 26.156.23.182      0.0%     5   46.2  44.7  42.1  47.9   2.2
11.|-- 96.34.2.171        0.0%     5   40.5  40.3  40.1  40.5   0.0
12.|-- 96.34.76.130       0.0%     5   41.5  41.4  40.7  41.9   0.0
13.|-- ???                100.0    5    0.0   0.0   0.0   0.0   0.0
[root@server bin]#"

...and below is what the 0.82 output looked like using the same command line options, notice the presence of the MPLS information at hops 7 and 8.

[root@server bin]# ./mtr-0.82 -n --psize 1360 -r -e -c 5 97.88.218.225
HOST: server                   Loss%   Snt   Last   Avg  Best  Wrst StDev
1.|-- 10.22.1.2                 0.0%     5    0.7   0.7   0.4   1.5   0.4
2.|-- ???                       100.0     5    0.0   0.0   0.0   0.0   0.0
3.|-- 161.8.134.45              0.0%     5    1.2   4.6   1.2  12.9   5.0
4.|-- 67.10.26.137              0.0%     5    6.6   6.9   6.4   7.7   0.5
5.|-- 67.14.211.18              0.0%     5   26.7  20.8  17.0  26.7   4.9
6.|-- 64.146.26.186             0.0%     5   19.6  19.3  17.4  24.0   2.7
7.|-- 27.88.4.238               0.0%     5   42.7  41.7  40.1  43.6   1.4
   |   +-- [MPLS: Lbl 16707 Exp 0 S 1 TTL 255]
8.|-- 27.88.2.28                0.0%     5   95.8  55.0  37.8  95.8  25.2
   |   +-- [MPLS: Lbl 614035 Exp 0 S 1 TTL 1]
9.|-- 26.156.1.13               0.0%     5   38.7  39.2  38.7  40.5   0.8
10.|-- 26.156.23.182             0.0%     5   48.4  43.9  41.3  48.4   2.8
11.|-- 96.34.2.171               0.0%     5   40.0  43.0  39.8  51.1   4.8
12.|-- 96.34.76.130              0.0%     5   41.6  40.8  40.0  41.6   0.7
   |  `|-- 96.34.76.229
13.|-- ???                       100.0     5    0.0   0.0   0.0   0.0   0.0
[root@server bin]#

Feature Request: Ability to set column width

Currently, regardless of how wide the terminal session is, mtr makes some formatting assumptions and truncates things the ping data (count, timing, etc.)

The ability to say "set the column width to XXX" would allow folks running with wide enough screens to show substantially more accurate data.

For instance, I have been using mtr to try and demonstrate to TWCBC that they've got a "sporadic heavy drop rate" on my line. I'll have brief periods every day of 100% packet loss, but while they're only 10 seconds here, 30 seconds there, they add up. The carrier claims it's just "a sporadic thing that day". I'd like to be able to run mtr for - literally - weeks or maybe even months straight, and say "I sent 7,500,000 packets, every second for the last three months, the overall loss rate is around 3.4%. That's not a one time sporadic thing, that's systemic". Or, "The stDev on this hop is like 10000.."

But the column widths on those right-side columns constantly tweak my ability to do that (especially the Snt column). I have to be like "ignore that, there's three digits missing ahead of it that are truncated".

Any chance of this getting added?

Compilation on OSX 10.8.3 (Mountain Lion)

Thank you for making this tool available, I hope that relating my experiences will contribute to your project. I followed the instructions in the readme to build the project, had a few issues along the way, but got there in the end.

  • There seems to be an issue in bootstrap.sh. Something about a missing GTK? related macro or define. Had modify that to generate the configure.
  • The configure seems to have ignored the "--without-gtk" option for the most part and left a few GTK related objects in the Makefile. I had to edit this a bit and add the "-DNO_GTK" define to the compiler flags so that display.c would link.
  • asn.c contains a quick check to exclude arpa/nameser_compat.h if its not available. Its supposed to be an OSX fix but it breaks the build. The current version of the development tools for OSX has that header. The code is written to these compatibility defines, so this header is not optional for now. (i.e.. the code uses PACKETSZ instead of NS_PACKETSZ). The label it's checking was not defined but, the header was available.
  • The readme content might need a review. I found references to a few things that might not exist anymore, or maybe I did not understand it.

Please ship a more modern icon for Traceroute

Hi, my name is Richard Hughes and I work at Red Hat. I'm trying to build a distro-neutral framework to make installing applications easier. At the moment I'm trying to contact various upstream authors asking them to do things to make their software show up. I've got support from a number of distros, KDE, XFCE and GNOME, but I also need some degree of maintainer buy-in. Already there are over 1000 applications listed in the metadata, and over 25% of them supply the nice-to-have AppData file with screenshots.

Traceroute does have a couple of small issues. It currently ships an XPM icon, which can't be parsed by the metadata extractor. The generator code is running 24x7 on a server, and so we've kept the supported icon formats to just .png and .svg for security reasons.

Would you perhaps consider shipping a more modern icon format such as PNG? To be included your application needs to ship an icon of at least 48x48px, and ideally 64x64px with an alpha channel to avoid padding. Additionally, please consider writing and installing an AppData file with the application description and some screenshots, otherwise your application will look kinda bare in the GNOME and KDE Software Centers. We'd also love to showcase more applications, but without the extra data file we can't.

See http://people.freedesktop.org/~hughsient/appdata/ for details about AppData and AppStream, or if you have any other questions please don't hesitate to ask; thanks!

Richard

Use libc resolver inside of own DNS code

Hi!

I noticed that mtr is using its own DNS code instead of the libc resolver. This makes some resolution fails. For example, for IP in /etc/hosts, we get no names. The same applies for stuff that should be learned through mDNS.

It seems that some work has already been done, as mentioned in #56. I didn't test the "newdns" branch yet. I open a new issue since #56 is not totally related and is already closed. Is there any reason that this branch cannot be merged yet? How can I help?

Ping graph scale is displaying incorrect values

Commit f2bc4aa introduced a bug where the ping graph in curses always shows the following scale regardless of min/max RTT:

Scale:  .:46 ms  1:49 ms  2:50 ms  3:51 ms  a:97 ms  b:98 ms  c:99 ms  >

This is caused by curses.c/mtr_curses_redraw() inadvertently using block_map[i] for the scale values instead of scale[i]/1000. A patch to fix this is below:

--- a/curses.c
+++ b/curses.c
@@ -683,7 +683,7 @@ void mtr_curses_redraw(void)
       attrset(block_col[i+1]);
       printw("%c", block_map[i]);
       attrset(A_NORMAL);
-      printw(":%d ms", block_map[i], scale[i]/1000);
+      printw(":%d ms", scale[i]/1000);
     }
     printw("  ");
     attrset(block_col[NUM_FACTORS]);

Configuration file for mtr

I would love to have a configuration file in

~/.mtr

or, even better,

$XDG_CONFIG_HOME/mtr/config

Support for system-wide configuration would be appreciated, as well.

This would allow me to default to -etn and to edit the field order and width as I prefer.

histograms like in prettyping/liboping

oping got this great feature now, inspired by prettyping, that shows the latency has a time-based histogram:

image

i looked at curses.c briefly, but it seems that modifying the block_map wouldn't suffice, we'd also need to mess around with the colors, and I couldn't find immediately where to do that.

pointers welcome.

Error message when IPv6 is not available at runtime

Our project (AstLinux) cross-compiles your mtr (via Buildroot) using an IPv6 enabled environment, as such "#ifdef ENABLE_IPV6" is true, but it is a run-time choice whether IPv6 is enabled by the user.

As such, if running as IPv4-only the error message...

Unable to allocate IPv6 socket for nameserver communication:

is always displayed. Currently we add this patch: http://svn.code.sf.net/p/astlinux/code/branches/1.0/package/mtr/mtr-remove-ipv6-error-warning.patch
possibly there is a better solution.

If "#ifdef ENABLE_IPV6" is true then IPv6 is available, but not necessarily used at runtime.

Providing API access

Very nice tool indeed.

Any chance that I can programmatically read the outputs of your program via some sort of API, so that I can send to my web services?

I know C / C++ / Python / Ruby.

Would be awesome if I could build upon your tool to create a real-time network monitoring service.

Thanks for a great tool!

Inclusion of -ltermcap on Solaris/illumos breaks formatting

Hi There,

On my SmartOS system, mtr builds with -ltermcap on Solaris which for some reason breaks the formatting horribly:

http://al.cloud.ec/mtr-broken.png
vs
http://al.cloud.ec/mtr-working.png

To fix the issue I simply did:

--- mtr/configure.ac    2013-10-25 11:34:35.000000000 +0000
+++ mtr/configure.ac    2013-10-25 11:35:09.827317223 +0000
@@ -23,7 +23,7 @@
 # We don't refer to any symbols in termcap, but -lcurses on SunOS does.
 # We have to trust the linker not to mess things up... (It should not
 # pull in anything if we don't refer to anything in the lib).
-AC_CHECK_LIB(termcap, tgetent)
+#AC_CHECK_LIB(termcap, tgetent)
 AC_CHECK_LIB(tinfo, tgetent)

 AC_CHECK_FUNC(initscr, ,

I don't know if you want to just get rid of the termcap check as most people will be using ncurses?

If anyone from the mtr team want a SmartOS zone (lightweight VM) to test fixes with I'd be happy to oblige!

It's also possible to sign up for a 60 day free trial on the Joyent cloud, which is SmartOS based:

http://www.joyent.com/blog/take-joyent-for-a-spin-with-a-free-trial

Thanks,

Alasdair

git version numbers are mangled

From the commit messages for 354c28d and efd76a7, I was under the impression that the version number when you compile from git would look about like "0.85+git:edd4258f". Instead, a friend just compiled it and got "edd4258f2516cd9dd8df354b76f69808472b9a98+git:".

That seems obviously wrong. There appears to be a mistake in the rather scary sed added to Makefile.am in 354c28d?

(I believe my friend's running an up-to-date Gentoo.)

Feature request: color coating for recent hops

I apologize if this is not the best place for a feature request... but here it goes:

As MTR runs, subsequent traces can and do traverse different hops so hop #7, for example, can show multiple hosts. It would be nice to differentiate which path was more recent and color coating could do the trick.

mtr 0.83 and 0.84 do not compile without glib (0.82 does)

Hi There,

mtr 0.83 and 0.84 seems do not compile without glib.h.

I use configure with the following options:
configure --prefix=/usr --sysconfdir=/etc --disable-ipv6 --without-gtk

While mtr 0.82 compiles fine, mtr 0.83 and 0.84 are missing glib.h:


root@debian:/mtr-0.83# make
(...)
In file included from mtr.c:37:0:
asn.h:19:18: fatal error: glib.h: No such file or directory
compilation terminated.
make[2]: *** [mtr.o] Error 1
make[2]: Leaving directory /root/mtr-0.83' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/root/mtr-0.83'
make: *** [all] Error 2
root@debian:
/mtr-0.83#


root@debian:/mtr-0.84# make
(...)
In file included from mtr.c:37:0:
asn.h:19:18: fatal error: glib.h: No such file or directory
compilation terminated.
make[2]: *** [mtr.o] Error 1
make[2]: Leaving directory /root/mtr-0.84' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/root/mtr-0.84'
make: *** [all] Error 2
root@debian:
/mtr-0.84#

Thanks in advance for any solution or any hint.

Cheers, Tom

[Question] Why can't I do a trace over VPN?

This particular trace over VPN (pptp+ppp) isn't working:

root@vivaldi:~# mtr -rc 1 87.248.210.253 [-a 192.168.3.234]
Start: Fri Mar 14 01:16:53 2014
HOST: vivaldi                     Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- 192.168.3.1                0.0%     1   73.0  73.0  73.0  73.0   0.0
  2.|-- ???                       100.0     1    0.0   0.0   0.0   0.0   0.0

Though I seem to get the ICMP error messages:

root@vivaldi:~# tcpdump icmp -tf
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ppp0, link-type LINUX_SLL (Linux cooked), capture size 65535 bytes
IP 192.168.3.234   > 87.248.210.253: ICMP echo request, id 48898, seq 59520, length 44
IP 192.168.3.1     > 192.168.3.234:  ICMP time exceeded in-transit, length 72
IP 192.168.3.234   > 87.248.210.253: ICMP echo request, id 48898, seq 59776, length 44
IP 188.40.45.1     > 192.168.3.234:  ICMP time exceeded in-transit, length 36
IP 192.168.3.234   > 87.248.210.253: ICMP echo request, id 48898, seq 60032, length 44
IP 213.239.227.161 > 192.168.3.234:  ICMP time exceeded in-transit, length 36
IP 192.168.3.234   > 87.248.210.253: ICMP echo request, id 48898, seq 60288, length 44
IP 213.239.245.41  > 192.168.3.234:  ICMP time exceeded in-transit, length 36
IP 192.168.3.234   > 87.248.210.253: ICMP echo request, id 48898, seq 60544, length 44
IP 213.239.245.29  > 192.168.3.234:  ICMP time exceeded in-transit, length 36
IP 192.168.3.234   > 87.248.210.253: ICMP echo request, id 48898, seq 60800, length 44
IP 213.239.245.26  > 192.168.3.234:  ICMP time exceeded in-transit, length 36
IP 192.168.3.234   > 87.248.210.253: ICMP echo request, id 48898, seq 61056, length 44
IP 77.109.135.101  > 192.168.3.234:  ICMP time exceeded in-transit, length 36
IP 192.168.3.234   > 87.248.210.253: ICMP echo request, id 48898, seq 61312, length 44
IP 77.109.140.154  > 192.168.3.234:  ICMP time exceeded in-transit, length 36

For reference:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    10     0        0 p4p1
87.248.210.253  0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
[my VPN server] 192.168.0.1     255.255.255.255 UGH   0      0        0 p4p1
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 p4p1
192.168.3.1     0.0.0.0         255.255.255.255 UH    0      0        0 ppp0

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:192.168.3.234  P-t-P:192.168.3.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1400  Metric:1
          RX packets:246 errors:0 dropped:0 overruns:0 frame:0
          TX packets:261 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:142870 (142.8 KB)  TX bytes:19618 (19.6 KB)

Don't think this is a bug because traceroute (stock, Ubuntu) behaves the same way. I'm guessing the ICMP errors don't make it back to mtr because the trace is cut short at 8 hops. But why is this?

After adding colors in ncurses, transparency is gone

Sorry for submitting the issue too early, I hit enter unintentionally. =)

So. After, I guess, f2bc4aa, and package update in ArchLinux (0.85→0.86, December 25th), mtr window is no longer transparent.

I guess, the background color is explicitly set to black.

Screenshot:

screenshot mtr no transparency

Above, my TERM=screen. When run with TERM=linux, e.g., it looks like this:

screenshot mtr no transparency

If there’s some env variable I could set to have the colors off, I’d rather have transparent and monochrome output. Of course, colored one with transparency would be the cutest. ♥

mtr: unable to get raw sockets.

$ brew install mtr --HEAD --verbose

==> Cloning https://github.com/traviscross/mtr.git
Cloning into '/Library/Caches/Homebrew/mtr--git'...
remote: Counting objects: 49, done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 49 (delta 11), reused 27 (delta 6)
Unpacking objects: 100% (49/49), done.
==> ./bootstrap.sh
==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/mtr/0.85 --without-gtk
==> make install

$ hash -r
$ mtr google.com
mtr: unable to get raw sockets.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.