9 ms·
gping: Ping, but with a graph
- rasengan 6y agoThis makes reviewing pings much easier. Great job.
- airocker 6y agoNice! Maybe a gtraceroute too?
- grahamburger 6y agomtr makes for a pretty decent gtraceroute
- aduitsis 6y agoVery nice! Noticed this uses pinger, which executes the actual ping command behind the scenes and parses the output. Which makes it fragile in case there are changes in the output format of ping. Are there any good alternative libraries that can use raw sockets, etc?
- m45t3r 6y agoThis is unlikely to change since if ping changes many programs would broke. It is kinda like ipconfig. AFAIK, ping is a setuid binary (since it needs raw socket, that is a privileged operation) so a program that implements ping by itself would need to do the same (or it would work for root).
- treve 6y agoWeird! Not setuid on my ubuntu machine.
- jandrese 6y agoIt is on my Ubuntu 18.04.5 LTS machine: -rwsr-xr-x 1 root root 64424 Jun 28 2019 /bin/ping
- unionpivo 6y agoIt's because of linux capabilities specificly CAP_NET_RAW How to check: $ getcap $(which ping) /usr/bin/ping = cap_net_raw+ep More about it on [1] https://blog.container-solutions.com/linux-capabilities-in-practice https://blog.container-solutions.com/linux-capabilities-in-p...
- jlgaddis 6y agoNowadays, the CAP_NET_RAW "capability" allows opening raw sockets by unprivileged users and without making binaries setuid.
- oarsinsync 6y ago> It is kinda like ipconfig. I assumed you were talking about windows until: > AFAIK, ping is a setuid binary Which unfortunately means you’ve partly helped make the GP’s point for them. Under Linux, the command you’re thinking of is ifconfig, which has long been deprecated and doesn’t ship by default anymore in newer distributions. Times change, tools move on.
- orf 6y agoI’ve just updated pinger to use a windows-specific API that doesn’t need root. But yes, in general it’s a nightmare especially with ping executables that don’t report timeouts at all. This is a great example of one of the failings of the UNIX model. You can’t really parse the ping output across distributions easily, it’s built for humans to consume and until recently didn’t even report timeouts to stdout. Not to mention needing to invoke “ping6” for ipv6, which I need to add support for. However it’s the best way to do this without needing to run gping and root.
- sacredcows 6y agoWe should do gls next
- njacobs5074 6y agoLooks great. How complicated to support multiple hosts? :)
- orf 6y agoThat’s a really great idea. Not hard I don’t think
- jrockway 6y agoI always liked gfblip: http://gfblip.appspot.com/ http://gfblip.appspot.com/ You can run this on your laptop and watch your WiFi drop in and out randomly (as other people around you download stuff, as Bluetooth devices interfere with it, etc.) It's also fun to run a speed test in another tab, and watch the latency increase 10x as needless buffers fill up and your latency-sensitive packets wait in line so your router gets a better review!
- Tarrosion 6y agoI found that tool from Ben Kuhn's blog, and at first it seemed great. But I've seen some weird behavior from it. Examples include drastically different behavior on a refresh (and not just for the 'blue' website, also for gstatic.com) and pings to Madagascar which are apparently faster than the speed of light. So now I'm somewhere between confused and distrustful. If anyone has a detailed guide on using gfblip I'd be really curious to read it.
- diggan 6y ago> If anyone has a detailed guide on using gfblip I'd be really curious to read it. Check out the instructions in the GitHub repository, has two versions, neither are very long nor complex. https://github.com/apenwarr/blip https://github.com/apenwarr/blip
- ngold 6y agoThat's a fun link.
- gojomo 6y agoIntriguing, but: I don't think it's working as intended from my Brave browser. After about 2 seconds of blue/green pings that seem faster than should be possible (<10ms), it goes full red. It does work in Chrome! (Perhaps, Brave is doing some faster-fail on the probe request from the beginning, and then a cached-insta-failure after ~2 seconds?)
- diggan 6y ago
- ballresin 6y agoMy project, similar but different: https://github.com/brendanporter/duck https://github.com/brendanporter/duck
- indit 6y agoA great project Brendan. But as stated in Github issues, it is not worked on newer version of Go. I'm trying in Windows 10 and get error which look like: `Error: 'date-time' main.go:59: open C:\Program Files Direct\duck\pings.json: The system cannot find the file specified.` `not supported by windows. Request timeout for icmp_seq xx`
- deleted 6y ago[deleted]
- michaelmior 6y agoprettyping[0] is a nice shell script that does a sparkline version of this. [0] https://github.com/denilsonsa/prettyping https://github.com/denilsonsa/prettyping
- cghendrix 6y agoPretty sweet
- mplanchard 6y agoJust noting that this doesn’t seem to have a license, which makes using it in certain settings pretty iffy. Nice project, anyway!
- steveklabnik 6y agoThe Cargo metadata says MIT.
- mplanchard 6y agoLegit question, does that work? I thought the license needed to be included with the source.
- steveklabnik 6y agoI am not a lawyer. Given that "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software." is in the license, and it isn't included... I dunno. But at the same time, the legal system doesn't work like code. It's more flexible. So, who knows?
- mplanchard 6y agoYeah, the license requiring itself to be included in copies was what I was thinking of. Not having it in there leaves it in a gray enough area that I would be hesitant to rely on it for something where the licensing was important. Very possible the metadata being there and indicating the unique(?) license identifier of “MIT” would be enough to convince a court in the event of Problems, but I also am not a lawyer and like my usage rights to be unambiguous.
- gertlex 6y agoI'm curious what the usecase of monitoring ping graphs by themselves is. Other than comparing with the ping graph of another device, or complaining that your internet connection is poor... it seems like other investigative tools would be needed for diagnosing. Maybe I'm just not imaginative enough!
- indigodaddy 6y agoPerhaps add support for also getting the actual normal/regular ping output so one can have that along with the graph? Apologize if that’s already there I was just looking at the usage video and switches and it appears to only output a graph? Would seem useful to also have the normal/traditional ping output as well.
- m000 6y ago215loc? This makes me want to (finally) sit and learn Rust. Even with Python + PyPi packages, I doubt you can do much better and still have a portable result.
- mhh__ 6y agoThis relies on libraries too. I reckon a D implementation would be a little bit shorter, I might try and write one tomorrow.
- deleted 6y ago[deleted]
- mhh__ 6y agoNot related to but, as you can see a trend in the pings over time on the graph it reminds me that even in a very granular benchmark it can be very helpful to plot the results first before trying to process them. For example, we sometimes blindly calculate the mean whereas the data may be such that we end up giving a value the benchmark will never reach.
- ImaCake 6y agoWell pings will have a bit of a weird distribution. If you did a histogram of your ping for a bit you would see most values sitting near some "floor" of X ms and then a long right-sided tail of values much larger than X ms. It seems to look sorta like a gamma distribution from a quick test of my wi-fi ping. The mean would sit somewhere to the right of the largest mass of ping times. If you wanted to know where most pings were you could look at the median (which will sit right where most pings are). If you were interested in the really large values of X ms then you could compare the mean and median to find out just how much those slow ping responses are dragging your mean away from the median.
- walrus01 6y agoeveryone should be familiar with the CLI tool 'mtr', which you can leave running for long periods of time inside a screen or termux session. https://en.wikipedia.org/wiki/MTR_(software) https://en.wikipedia.org/wiki/MTR_(software)
- newman314 6y agoIf you pass the -z switch to mtr, it also shows the associated AS.
- dima55 6y agoOr you can do this in general: ping 8.8.8.8 | perl -ne 'BEGIN {$|=1;} s/.*=([0-9\.]+) ms$/\1/ && print'| feedgnuplot --stream --ylabel "Ping time (in ms)" --lines Advantage: works for ANY input, not just pings. And is infinitely more flexible. Want a histogram of your pings updating in realtime? Here you go: ping 8.8.8.8 | perl -ne 'BEGIN {$|=1;} s/.*=([0-9\.]+) ms$/\1/ && print'| feedgnuplot --stream --histo 0 --binwidth 1
- tutfbhuf 6y agoBut therefore you need perl, gnuplot and feedgnuplot, the latter isn't even available via package manager on my distro.
- tjoff 6y agoFantastic, thanks, I think this was the final push I needed to start abusing gnuplot. Though for some reason the plot only updates when I give or take the plot window focus (refreshperiod mentioned in the man page doesn't seem to help, and I think it should default to 1Hz).
- tjoff 6y agoFix for this issue (on wayland) mentioned here: GDK_BACKEND=x11 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=942570 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=942570
- ktpsns 6y agoAnother great example how a couple of traditional unix tools (if you want to count perl and gnuplot as traditional unix tools) can replace 250 lines of high-level language code (https://github.com/orf/gping/blob/master/src/main.rs https://github.com/orf/gping/blob/master/src/main.rs).
- chrismorgan 6y agoA thing I’d really like and have contemplated making is graphs like this for mtr rather than ping. That way you can see how things are changing at each hop—if my network isn’t working perfectly, I always jump to mtr rather than ping, because it shows me whether the problem is between my laptop and the router, the router and the ISP, the ISP and the world, or near the end server. For best results you’d probably want a full 3D chart rather than just side-by-side 2D charts which is the best you could do in a terminal.
- gorgoiler 6y agoI like how the more recent versions of mtr have a coloured heat map, showing the 3D data, essentially. (x=time of test, y=hops, z/color=ping time)
- samoa42 6y agothere is also https://noping.cc https://noping.cc available in many os-repos supports tighter measurement intervals
- neurostimulant 6y agoThe cargo version seem to hanging on my ubuntu 20.04 machine and rust v1.47.
- ZoomZoomZoom 6y agoShouldn't this be named nping? I'm not 100% serious there, but why break conventions? g is for GUI, n is fo TUI (from ncurses).
- orf 6y agoI didn’t put too much thought into the name. It’s ping, with a graph. Graph ping. gping. nping does sound kind of interesting, but meh.