Announcing a prettier noping

I have implemented really pretty histograms in the venerable ping software, something I never thought could be improved, until I discovered prettyping.sh, something that was just begging for improvements.

Which are now done.

But first some history...

First, in 1983 (!), there was ping and network operators rejoiced, as they could see if a host was down or not, and have all sorts of geeky statistics:

PING koumbit.net (209.44.112.66): 48 data bytes
56 bytes from 209.44.112.66: icmp_seq=0 ttl=52 time=25.076 ms
56 bytes from 209.44.112.66: icmp_seq=1 ttl=52 time=24.006 ms
56 bytes from 209.44.112.66: icmp_seq=2 ttl=52 time=24.106 ms
^C--- koumbit.net ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 24.006/24.396/25.076/0.483 ms

Then, in 2006, there was noping, and things were, well, not much better, but we had colors and could ping multiple hosts at once, and there was some rejoicing.

noping before

Then, in october 2013, there was prettyping.sh(announcement), and things got really flashy and "oh wow, you can do that?" There was much rejoicing.

prettyping animation

Then, tonight, I learned ncurses and there was much headaches.

But then, I reimplemented prettyping in noping, and I am so happy that I wrote this blog post:

noping now

Unless you haven't figured out how cool this is, let me break it down for you:

  1. it supports IPv4 and IPv6
  2. it allows you to track multiple hosts at the same time, and compare them
  3. this allows you to easily track down failure points in a network, something for which you usually need smokeping (needs a webserver) or mtr (doesn't have colors)
  4. it allows you to track a lot (the last minute at least) of history by default
  5. it is visually easy to track, even from a distance

You may know of that hack that can make "ping" ring a bell when it receives a packet? This is better: you can see the packets latency (or when they are just dropped!) from a distance, using an intuitive color code.

Thanks to the well architectured noping, the patches were not that complicated to implemented.

The code was submitted as a pull request upstream and merged in the 1.7.0 release. This is also part of your favorite Debian distribution (Debian Jessie).

Rejoice!

Commentaires

Portrait de anarcat

#1 anarcat : upstream and debian update

This functionality has been included in the Debian package since version 1.6.2-3 (Debian Jessie) and upstream with release 1.7.0.


Portrait de Valent

#2 Valent : How to get pretty colors? :)

I have oping 1.6.1 installed and tried running it with two hosts but there are no colors being shown. What is the issue?

oping 10.254.0.2 10.254.241.193

Do I need some additional parameters? Is your patch implemented in oping 1.6.1 or some later version?


Portrait de Jason Lews

#3 Jason Lews : compile problem

Hi,

I saw your post and thought I'd give it a go, however when I try and compile I get an error:

Making all in bindings
make[1]: Entering directory `/home/jason/source/liboping/bindings'
if test ! -d perl; then \
                for file in perl/Changes perl/MANIFEST perl/META.yml perl/Makefile.PL perl/Oping.xs perl/README perl/lib/Net/Oping.pm perl/t/Oping.t perl/typemap; do \
                        mkdir -p `dirname $file`; \
                        cp ./$file `dirname $file`; \
                done \
        fi
cd perl && perl Makefile.PL PREFIX="/opt/oping" TOP_BUILDDIR=".." TARGET_LIBDIR="/opt/oping/lib"
Checking if your kit is complete...
Looks good
Only one of PREFIX or INSTALL_BASE can be given.  Not both.
make[1]: *** [perl/Makefile] Error 255
make[1]: Leaving directory `/home/jason/source/liboping/bindings'
make: *** [all-recursive] Error 1

Steps to reproduce:

$ git clone -b prettyping git://src.anarc.at/liboping
$ cd liboping/
$ ./autogen.sh
$ ./configure
$ make

this is on debian 7.1
with perl installed via perlbrew. perl-5.16.3

I fetched version 58fd85d1d65fc770fa6895d21ffb2973cb8e10fc


Portrait de anarcat

#4 anarcat : I can't reproduce this

I can't reproduce this here:

anarcat@marcos:~$ cd /tmp
anarcat@marcos:tmp$ git clone -b prettyping git://src.anarc.at/liboping
Clonage dans 'liboping'
remote: Counting objects: 1282, done.
remote: Compressing objects: 100% (402/402), done.
remote: Total 1282 (delta 863), reused 1229 (delta 830)
Receiving objects: 100% (1282/1282), 184.38 KiB | 0 bytes/s, done.
Resolving deltas: 100% (863/863), done.
Checking connectivity... done
anarcat@marcos:tmp$ cd liboping/
anarcat@marcos:liboping$ ./autogen.sh
libtoolize: putting auxiliary files in `.'.
libtoolize: linking file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: linking file `m4/libtool.m4'
libtoolize: linking file `m4/ltoptions.m4'
libtoolize: linking file `m4/ltsugar.m4'
libtoolize: linking file `m4/ltversion.m4'
libtoolize: linking file `m4/lt~obsolete.m4'
configure.ac:46: installing `./config.guess'
configure.ac:46: installing `./config.sub'
configure.ac:8: installing `./install-sh'
configure.ac:8: installing `./missing'
Makefile.am: installing `./INSTALL'
autoconfiguration done, to build: ./configure ; make
anarcat@marcos:liboping$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... none
checking how to run the C preprocessor... gcc -E
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... no
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for ANSI C header files... (cached) yes
checking whether time.h and sys/time.h may both be included... yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for inttypes.h... (cached) yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for netinet/in_systm.h... yes
checking for netinet/in.h... yes
checking for netinet/ip.h... yes
checking for netinet/ip_icmp.h... yes
checking for netinet/ip_var.h... no
checking for netinet/ip6.h... yes
checking for netinet/icmp6.h... yes
checking for size_t... yes
checking for ssize_t... yes
checking for uid_t in sys/types.h... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint8_t... yes
checking for socket... yes
checking for __xnet_recvmsg in -lxnet... no
checking for nanosleep... yes
checking ncursesw/ncurses.h usability... yes
checking ncursesw/ncurses.h presence... yes
checking for ncursesw/ncurses.h... yes
checking for mvwprintw in -lncursesw... yes
checking whether strerror_r is declared... yes
checking for strerror_r... yes
checking whether strerror_r returns char *... no
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking whether strerror_r is declared... (cached) yes
checking for strerror_r... (cached) yes
checking whether strerror_r returns char *... (cached) no
checking for gettimeofday... yes
checking for memset... yes
checking for modf... yes
checking for select... yes
checking for socket... (cached) yes
checking for sqrt... no
checking for strcasecmp... yes
checking for strdup... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strtoul... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/mans/Makefile
config.status: creating bindings/Makefile
config.status: creating src/config.h
config.status: executing depfiles commands
config.status: executing libtool commands
anarcat@marcos:liboping$ make
Making all in src
make[1]: entrant dans le répertoire « /tmp/liboping/src »
make  all-recursive
make[2]: entrant dans le répertoire « /tmp/liboping/src »
Making all in mans
make[3]: entrant dans le répertoire « /tmp/liboping/src/mans »
pod2man --section=3 --release=1.6.2 --center=liboping liboping.pod >liboping.3
pod2man --section=3 --release=1.6.2 --center=liboping ping_construct.pod >ping_construct.3
pod2man --section=3 --release=1.6.2 --center=liboping ping_setopt.pod >ping_setopt.3
pod2man --section=3 --release=1.6.2 --center=liboping ping_host_add.pod >ping_host_add.3
pod2man --section=3 --release=1.6.2 --center=liboping ping_send.pod >ping_send.3
pod2man --section=3 --release=1.6.2 --center=liboping ping_get_error.pod >ping_get_error.3
pod2man --section=3 --release=1.6.2 --center=liboping ping_iterator_get.pod >ping_iterator_get.3
pod2man --section=3 --release=1.6.2 --center=liboping ping_iterator_get_info.pod >ping_iterator_get_info.3
pod2man --section=3 --release=1.6.2 --center=liboping ping_iterator_get_context.pod >ping_iterator_get_context.3
pod2man --section=8 --release=1.6.2 --center=liboping oping.pod >oping.8
make[3]: quittant le répertoire « /tmp/liboping/src/mans »
make[3]: entrant dans le répertoire « /tmp/liboping/src »
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -Wall -Werror -g -O2 -c -o liboping_la-liboping.lo `test -f 'liboping.c' || echo './'`liboping.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wall -Werror -g -O2 -c liboping.c  -fPIC -DPIC -o .libs/liboping_la-liboping.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wall -Werror -g -O2 -c liboping.c -o liboping_la-liboping.o >/dev/null 2>&1
/bin/bash ../libtool --tag=CC   --mode=link gcc -Wall -Werror -g -O2  -version-info 2:9:2  -o liboping.la -rpath /opt/oping/lib liboping_la-liboping.lo
libtool: link: gcc -shared  -fPIC -DPIC  .libs/liboping_la-liboping.o    -O2   -Wl,-soname -Wl,liboping.so.0 -o .libs/liboping.so.0.2.9
libtool: link: (cd ".libs" && rm -f "liboping.so.0" && ln -s "liboping.so.0.2.9" "liboping.so.0")
libtool: link: (cd ".libs" && rm -f "liboping.so" && ln -s "liboping.so.0.2.9" "liboping.so")
libtool: link: ar cru .libs/liboping.a  liboping_la-liboping.o
libtool: link: ranlib .libs/liboping.a
libtool: link: ( cd ".libs" && rm -f "liboping.la" && ln -s "../liboping.la" "liboping.la" )
gcc -DHAVE_CONFIG_H -I.    -Wall -Werror -g -O2 -c oping.c
/bin/bash ../libtool --tag=CC   --mode=link gcc -Wall -Werror -g -O2   -o oping oping.o liboping.la -lm
libtool: link: gcc -Wall -Werror -g -O2 -o .libs/oping oping.o  ./.libs/liboping.so -lm -Wl,-rpath -Wl,/opt/oping/lib
gcc -DHAVE_CONFIG_H -I.   -DUSE_NCURSES=1  -Wall -Werror -g -O2 -c -o noping-oping.o `test -f 'oping.c' || echo './'`oping.c
/bin/bash ../libtool --tag=CC   --mode=link gcc -Wall -Werror -g -O2   -o noping noping-oping.o liboping.la -lm -lncursesw
libtool: link: gcc -Wall -Werror -g -O2 -o .libs/noping noping-oping.o  ./.libs/liboping.so -lm -lncursesw -Wl,-rpath -Wl,/opt/oping/lib
make[3]: quittant le répertoire « /tmp/liboping/src »
make[2]: quittant le répertoire « /tmp/liboping/src »
make[1]: quittant le répertoire « /tmp/liboping/src »
Making all in bindings
make[1]: entrant dans le répertoire « /tmp/liboping/bindings »
if test ! -d perl; then \
                for file in perl/Changes perl/MANIFEST perl/META.yml perl/Makefile.PL perl/Oping.xs perl/README perl/lib/Net/Oping.pm perl/t/Oping.t perl/typemap; do \
                        mkdir -p `dirname $file`; \
                        cp ./$file `dirname $file`; \
                done \
        fi
cd perl && perl Makefile.PL PREFIX="/opt/oping" TOP_BUILDDIR=".." TARGET_LIBDIR="/opt/oping/lib"
Checking if your kit is complete...
Looks good
Warning: -L../../src/.libs changed to -L/tmp/liboping/bindings/perl/../../src/.libs
Writing Makefile for Net::Oping
Writing MYMETA.yml
cd perl && make
make[2]: entrant dans le répertoire « /tmp/liboping/bindings/perl »
cp lib/Net/Oping.pm blib/lib/Net/Oping.pm
/usr/bin/perl /usr/share/perl/5.14/ExtUtils/xsubpp  -typemap /usr/share/perl/5.14/ExtUtils/typemap -typemap typemap  Oping.xs > Oping.xsc && mv Oping.xsc Oping.c
cc -c  -I../../src -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"1.21\" -DXS_VERSION=\"1.21\" -fPIC "-I/usr/lib/perl/5.14/CORE"   Oping.c
Running Mkbootstrap for Net::Oping ()
chmod 644 Oping.bs
rm -f blib/arch/auto/Net/Oping/Oping.so
LD_RUN_PATH="/tmp/liboping/bindings/perl/../../src/.libs" cc  -L../../src/.libs -shared -L/usr/local/lib -fstack-protector -Wl,-rpath -Wl,"/opt/oping/lib" Oping.o  -o blib/arch/auto/Net/Oping/Oping.so        \
           -L/tmp/liboping/bindings/perl/../../src/.libs -loping        \

chmod 755 blib/arch/auto/Net/Oping/Oping.so
cp Oping.bs blib/arch/auto/Net/Oping/Oping.bs
chmod 644 blib/arch/auto/Net/Oping/Oping.bs
Manifying blib/man3/Net::Oping.3pm
make[2]: quittant le répertoire « /tmp/liboping/bindings/perl »
[ ! -f perl/Makefile ] || ( cd perl && make all )
make[2]: entrant dans le répertoire « /tmp/liboping/bindings/perl »
make[2]: quittant le répertoire « /tmp/liboping/bindings/perl »
make[1]: quittant le répertoire « /tmp/liboping/bindings »
make[1]: entrant dans le répertoire « /tmp/liboping »
make[1]: Rien à faire pour « all-am ».
make[1]: quittant le répertoire « /tmp/liboping »

... works fine here, also Debian 7.1:

anarcat@marcos:liboping$ dpkg -l autoconf libtool automake
Souhait=inconnU/Installé/suppRimé/Purgé/H=à garder
| État=Non/Installé/fichier-Config/dépaqUeté/échec-conFig/H=semi-installé/W=attend-traitement-déclenchements
|/ Err?=(aucune)/besoin Réinstallation (État,Err: majuscule=mauvais)
||/ Nom            Version      Architecture Description
+++-==============-============-============-=================================
ii  autoconf       2.69-1       all          automatic configure script builde
ii  automake       1:1.11.6-1   all          Tool for generating GNU Standards
ii  libtool        2.4.2-1.1    amd64        Generic library support script

Portrait de anarcat

#5 anarcat : update: now a pull request

Upstream is quite interested in the patch, and there's now a pull request, which details current challenges:

https://github.com/octo/liboping/pull/3


Portrait de Dirk

#6 Dirk : Very good. I would suggest to

Very good. I would suggest to improve the data-ink ratio by leaving out the boxes around the result. http://www.infovis-wiki.net/index.php/Data-Ink_Ratio


Portrait de anarcat

#7 anarcat : Well, those borders were

Well, those borders were there before I started working on noping, so I suggest you take that upstream.

Also, I find it ironic that, in the article you posted, one of the formulas is shown in a graphic with two useless borders, violating the rules it is trying to describe. :)