Giter Club home page Giter Club logo

gping's Introduction

gping ๐Ÿš€

Crates.io Actions Status

Ping, but with a graph.

Comes with the following super-powers:

  • Graph the ping time for multiple hosts
  • Graph the execution time for commands via the --cmd flag
  • Custom colours
  • Windows, Mac and Linux support

Table of Contents

Packaging status

Install ๐Ÿ’ฟ

  • macOS
  • Linux (Homebrew): brew install gping
  • CentOS (and other distributions with an old glibc): Download the MUSL build from the latest release
  • Windows/ARM:
  • Fedora (COPR): sudo dnf copr enable atim/gping -y && sudo dnf install gping
  • Cargo (This requires rustc version 1.67.0 or greater): cargo install gping
  • Arch Linux: pacman -S gping
  • Alpine linux: apk add gping
  • Ubuntu >23.10/Debian >13: apt install gping
  • Ubuntu/Debian (Azlux's repo):
echo 'deb [signed-by=/usr/share/keyrings/azlux.gpg] https://packages.azlux.fr/debian/ bookworm main' | sudo tee /etc/apt/sources.list.d/azlux.list
sudo apt install gpg
curl -s https://azlux.fr/repo.gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/azlux.gpg > /dev/null
sudo apt update
sudo apt install gping
sudo eselect repository enable dm9pZCAq
sudo emerge --sync dm9pZCAq
sudo emerge net-misc/gping::dm9pZCAq
  • FreeBSD:
    • pkg: pkg install gping
    • ports cd /usr/ports/net-mgmt/gping; make install clean
  • Docker:
# Check all options
docker run --rm -ti --network host ghcr.io/orf/gping:gping-v1.15.1 --help
# Ping google.com
docker run --rm -ti --network host ghcr.io/orf/gping:gping-v1.15.1 google.com

Usage ๐ŸŽท

Just run gping [host]. host can be a command like curl google.com if the --cmd flag is used. You can also use shorthands like aws:eu-west-1 or aws:ca-central-1 to ping specific cloud regions. Only aws is currently supported.

$ gping --help
Ping, but with a graph.

Usage: gping [OPTIONS] [HOSTS_OR_COMMANDS]...

Arguments:
  [HOSTS_OR_COMMANDS]...  Hosts or IPs to ping, or commands to run if --cmd is provided. Can use cloud shorthands like aws:eu-west-1.

Options:
      --cmd
          Graph the execution time for a list of commands rather than pinging hosts
  -n, --watch-interval <WATCH_INTERVAL>
          Watch interval seconds (provide partial seconds like '0.5'). Default for ping is 0.2, default for cmd is 0.5.
  -b, --buffer <BUFFER>
          Determines the number of seconds to display in the graph. [default: 30]
  -4
          Resolve ping targets to IPv4 address
  -6
          Resolve ping targets to IPv6 address
  -i, --interface <INTERFACE>
          Interface to use when pinging
  -s, --simple-graphics
          Uses dot characters instead of braille
      --vertical-margin <VERTICAL_MARGIN>
          Vertical margin around the graph (top and bottom) [default: 1]
      --horizontal-margin <HORIZONTAL_MARGIN>
          Horizontal margin around the graph (left and right) [default: 0]
  -c, --color <color>
          Assign color to a graph entry. This option can be defined more than once as a comma separated string, and the order which the colors are provided will be matched against the hosts or commands passed to gping. Hexadecimal RGB color codes are accepted in the form of '#RRGGBB' or the following color names: 'black', 'red', 'green', 'yellow', 'blue', 'magenta','cyan', 'gray', 'dark-gray', 'light-red', 'light-green', 'light-yellow', 'light-blue', 'light-magenta', 'light-cyan', and 'white'
  -h, --help
          Print help information
  -V, --version
          Print version information
      --clear
          Clear the graph from the terminal after closing the program

gping's People

Contributors

aragonnetje6 avatar azlux avatar baoyachi avatar barrowsys avatar conorbros avatar dependabot[bot] avatar djinn avatar dm9pzcaq avatar entilzha avatar github-actions[bot] avatar hbina avatar icp1994 avatar jmuia avatar kidonng avatar louisbrunner avatar netravnen avatar niutech avatar orf avatar p2004a avatar p3terx avatar peshmerge avatar petervaro avatar phcco avatar pmccauley1994 avatar purplebabar avatar thepacketgeek avatar thynix avatar tzyluen avatar yabberyabber avatar ymosy 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

gping's Issues

Doesn't work with python 2.7

$ gping
Traceback (most recent call last):
  File "/usr/local/bin/gping", line 9, in <module>
    load_entry_point('pinggraph==0.0.9', 'console_scripts', 'gping')()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 558, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2355, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2361, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python2.7/dist-packages/gping/pinger.py", line 89
    def line(self, from_: P, to: P, paint=None, character=None):
                        ^
SyntaxError: invalid syntax

and

Traceback (most recent call last):
  File "/usr/local/bin/gping", line 9, in <module>
    load_entry_point('pinggraph==0.0.9', 'console_scripts', 'gping')()
  File "/usr/local/lib/python2.7/dist-packages/gping/pinger.py", line 293, in run
    _run()
  File "/usr/local/lib/python2.7/dist-packages/gping/pinger.py", line 288, in _run
    print("\n".join(c.process_colors()))
  File "/usr/local/lib/python2.7/dist-packages/gping/pinger.py", line 138, in process_colors
    r.write(d)
TypeError: unicode argument expected, got 'str'

snap permission error

Installed via snap install gping on Ubuntu and running gives me this error:

Traceback (most recent call last):
  File "/snap/gping/13/bin/gping", line 11, in <module>
    load_entry_point('pinggraph==1.0', 'console_scripts', 'gping')()
  File "/snap/gping/13/lib/python3.5/site-packages/gping/pinger.py", line 313, in run
    _run()
  File "/snap/gping/13/lib/python3.5/site-packages/gping/pinger.py", line 338, in _run
    for line in it(options):
  File "/snap/gping/13/lib/python3.5/site-packages/gping/pinger.py", line 251, in _inner
    ping = subprocess.Popen(args, stdout=subprocess.PIPE)
  File "/snap/gping/13/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/snap/gping/13/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg)
PermissionError: [Errno 13] Permission denied

crash: round(float(darwin_re.search(line).group(5))): AttributeError: 'NoneType' ...

This looks newer than #2 and #11, though it seems similar.

Traceback (most recent call last):
File "/usr/local/bin/gping", line 11, in
sys.exit(run())
File "/usr/local/lib/python3.6/site-packages/gping/pinger.py", line 314, in run
_run()
File "/usr/local/lib/python3.6/site-packages/gping/pinger.py", line 339, in _run
for line in it(options):
File "/usr/local/lib/python3.6/site-packages/gping/pinger.py", line 264, in _inner
result = func(line)
File "/usr/local/lib/python3.6/site-packages/gping/pinger.py", line 293, in darwin_ping
return round(float(darwin_re.search(line).group(5)))
AttributeError: 'NoneType' object...

I see this once in awhile, but not sure what triggers it. I'll try adding some debug output...

Colorama required on Windows

Great tool :)

I'm using Windows 8.1 and downloaded Python 3.5.0 from https://www.python.org/downloads/windows/.
After installing pinggraph and statistics from pip3, I still got the following error:

ฮป gping 8.8.8.8
Traceback (most recent call last):
  File "c:\users\dennis_lpt\appdata\local\programs\python\python35\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\dennis_lpt\appdata\local\programs\python\python35\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\dennis_lpt\AppData\Local\Programs\Python\Python35\Scripts\gping.exe\__main__.py", line 5, in <module>
  File "c:\users\dennis_lpt\appdata\local\programs\python\python35\lib\site-packages\gping\pinger.py", line 10, in <module>
    from colorama import Fore, init
ImportError: No module named 'colorama'

After installing colorama via pip3, everything works.

Maybe you could add this to the readme?

Titles in graphs

When diagnosing network issues, I sometimes open many windows in tmux. Without additional annotation, it's difficult to tell what graph is what host.

image

I'd like to propose putting the hostname being pinged in a corner of the screen.

Error/Traceback when quitting gping with CTRL+C

I use Windows 8.1 with Python 3.5.0 and get the following error when CTRL+Cing gping:

Traceback (most recent call last):
  File "c:\users\dennis_lpt\appdata\local\programs\python\python35\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\dennis_lpt\appdata\local\programs\python\python35\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\dennis_lpt\AppData\Local\Programs\Python\Python35\Scripts\gping.exe\__main__.py", line 9, in <module>
  File "c:\users\dennis_lpt\appdata\local\programs\python\python35\lib\site-packages\gping\pinger.py", line 251, in run
    for ping in it(url):
  File "c:\users\dennis_lpt\appdata\local\programs\python\python35\lib\site-packages\gping\pinger.py", line 213, in _windows
    line = ping.stdout.readline().decode()
KeyboardInterrupt

It's just an esthetic issue, not impairing anything at all. Thought it might be worth reporting.

Multi-Line string and Annotations

  1. So I fokred the repo and tried to run it on my OS X Yosemite but because of all the annotations it wont work. Python 2 doesnt support them.
  2. Is there a way to create perhaps another folder inside the master for python 2, if yes ill try to work on it.

Doesn't work on linux mint

On Linux Mint I get the following error:

gping google.com

Traceback (most recent call last):
File "/usr/local/bin/gping", line 7, in
from gping.pinger import run
File "/usr/local/lib/python3.4/dist-packages/gping/pinger.py", line 11, in
from colorama.ansitowin32 import winterm
ImportError: cannot import name 'winterm'

Can you give any hints on how this could be solved?

Unable to set ping wait interval on OS X

Setting the interval with -i5 works with regular ping (5 seconds between pings), but the same flag passed to gping throws duplicated error messages:

[ ~ ]$ python3 --version
Python 3.5.0
[ ~ ]$ ping -i5 google.com
PING google.com (216.58.192.14): 56 data bytes
64 bytes from 216.58.192.14: icmp_seq=0 ttl=53 time=44.896 ms
64 bytes from 216.58.192.14: icmp_seq=1 ttl=53 time=36.484 ms
^C
--- google.com ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 36.484/40.690/44.896/4.206 ms
[ ~ ]$ gping -i5 google.com
usage: ping [-AaDdfnoQqRrv] [-b boundif] [-c count] [-G sweepmaxsize]
            [-g sweepminsize] [-h sweepincrsize] [-i wait] [โˆ’k trafficclass]
            [-l preload] [-M mask | time] [-m ttl] [-p pattern]
            [-S src_addr] [-s packetsize] [-t timeout][-W waittime] [-z tos]
            host
       ping [-AaDdfLnoQqRrv] [-b boundif] [-c count] [-I iface] [-i wait]
            [โˆ’k trafficclass] [-l preload] [-M mask | time] [-m ttl] [-p pattern] [-S src_addr]
            [-s packetsize] [-T ttl] [-t timeout] [-W waittime]
            [-z tos] mcast-group
[ ~ ]$

not pinging on ubuntu 16.04

I've installed gping using snap on an Ubunti 16.04 host with the following cmd:

sudo snap install gping && sudo snap connect gping:network-observe

If i do run

gping -I INTERFACENAME NAME-OF-TARGET

Please check the attached image for the output

gping_on_ubuntu_1604

I do know that NAME-OF-TARGET is pingable at that moment using classic ping command.

Lost packets are not displayed

I was hoping to use gping to debug intermittent connectivity issues, by running it on multiple hosts with multiple targets to figure out what part of my network occasionally breaks. However, it seems that if ping packets get lost, the display just stops, rather than showing the lost packets. This effectively means that gping is not usable for the case I had in mind. Would it make sense to explicitly show lost packets (this might need to have a timeout, to consider a packet lost after some time, or after the next reply is received, but probably also needs retroactively updating a packet later when it is received after all.

Encoding issue [Win10-x64]

My system language is russian, so terminal codepage is 866. When i'm trying to run script, i get:
Traceback (most recent call last): File "C:\Anaconda\lib\runpy.py", line 170, in _run_module_as_main "__main__", mod_spec) File "C:\Anaconda\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Anaconda\Scripts\gping.exe\__main__.py", line 9, in <module> File "C:\Anaconda\lib\site-packages\gping\pinger.py", line 294, in run _run() File "C:\Anaconda\lib\site-packages\gping\pinger.py", line 281, in _run for ping in it(url): File "C:\Anaconda\lib\site-packages\gping\pinger.py", line 227, in _windows line = ping.stdout.readline().decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8e in position 0: invalid start byte

If change decode() to decode('CP866') or decode('win-1251') it works, but outputs nothing. (And i can't found where to change output encoding). Solution is to run chcp 65001 before executing script. Maybe add this to script by default? (But i don't know how exactly to do this, because subprocess.Popen(["chcp","65001"]) doesn't work - seems that chcp is not executable file.)

Doesn't work under Windows 10 20H2

Hi there. As the title says, i've just tried the last version under Windows 10 20H2 without success:

gping host = blank window with blinking cursor. Tried with standard cmd shell and the new Windows Terminal: same results.

Regex error

Getting what looks like a regex bug. Running on Mac OSX 10.11 with python 3.5

$ gping google.com
Traceback (most recent call last):
  File "/usr/local/bin/gping", line 11, in <module>
    sys.exit(run())
  File "/usr/local/lib/python3.5/site-packages/gping/pinger.py", line 251, in run
    for ping in it(url):
  File "/usr/local/lib/python3.5/site-packages/gping/pinger.py", line 225, in _linux
    yield round(float(linux_re.search(line).group(1)))
AttributeError: 'NoneType' object has no attribute 'group'

Since there is apparently a failed match the match is None which is why it errors.

Crashes when window is resized too small

Steps to reproduce: Start gping, resize terminal window vertically until it is very small.

Traceback (most recent call last):
File "/snap/gping/13/bin/gping", line 11, in
load_entry_point('pinggraph==1.0', 'console_scripts', 'gping')()
File "/snap/gping/13/lib/python3.5/site-packages/gping/pinger.py", line 313, in run
run()
File "/snap/gping/13/lib/python3.5/site-packages/gping/pinger.py", line 343, in run
plotted = plot(width, height, buff, host)
File "/snap/gping/13/lib/python3.5/site-packages/gping/pinger.py", line 201, in plot
blank=True
File "/snap/gping/13/lib/python3.5/site-packages/gping/pinger.py", line 100, in box
self.line(last_point, point, paint=paint, character=" " if blank else None)
File "/snap/gping/13/lib/python3.5/site-packages/gping/pinger.py", line 79, in line
self.vertical_line(character, from
.x, from
.y, to.y, paint)
File "/snap/gping/13/lib/python3.5/site-packages/gping/pinger.py", line 72, in vertical_line
self[column, y] = (next(data_iter), paint)
File "/snap/gping/13/lib/python3.5/site-packages/gping/pinger.py", line 52, in setitem
self.data[int(-y)][int(x)] = data
IndexError: list index out of range

gping crashes when terminal is less than 10 rows high

I just started using gping today. Great program. I was playing with the terminal window, trying to figure out how many ms a bar represents at different heights. If I make the terminal too small vertically, it crashes:

Traceback (most recent call last):
File "/usr/local/bin/gping", line 11, in
sys.exit(run())
File "/usr/local/lib/python3.6/site-packages/gping/pinger.py", line 314, in run
run()
File "/usr/local/lib/python3.6/site-packages/gping/pinger.py", line 344, in run
plotted = plot(width, height, buff, host)
File "/usr/local/lib/python3.6/site-packages/gping/pinger.py", line 202, in plot
blank=True
File "/usr/local/lib/python3.6/site-packages/gping/pinger.py", line 101, in box
self.line(last_point, point, paint=paint, character=" " if blank else None)
File "/usr/local/lib/python3.6/site-packages/gping/pinger.py", line 80, in line
self.vertical_line(character, from
.x, from
.y, to.y, paint)
File "/usr/local/lib/python3.6/site-packages/gping/pinger.py", line 73, in vertical_line
self[column, y] = (next(data_iter), paint)
File "/usr/local/lib/python3.6/site-packages/gping/pinger.py", line 53, in setitem
self.data[int(-y)][int(x)] = data
IndexError: list index out of range

Seems like 10 rows works, and less than that it crashes.
I'm running this on Mac with the Terminal app.

gping -help or gping -h is blocking

Hi. Nice script ๐Ÿ‘ !

But, asking for help blocks completely the script:

$ gping -help
Usage: ping [-aAbBdDfhLnOqrRUvV] [-c count] [-i interval] [-I interface]
            [-m mark] [-M pmtudisc_option] [-l preload] [-p pattern] [-Q tos]
            [-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp_option]
            [-w deadline] [-W timeout] [hop1 ...] destination

(nothing else, it stops here, blocked)

Then it consumes 100% of one core without doing anything:
100_percent_gping_help

(it might be a Python2 / pip2 specific problem, I have not tried with pip3)

Wrong ping numbers

Installed via cargo install gping on ubuntu 18.04. gping 0.1.4

Ping response:

(base) _  ~ ping google.com
PING google.com (172.217.26.174) 56(84) bytes of data.
64 bytes from maa03s22-in-f174.1e100.net (172.217.26.174): icmp_seq=1 ttl=117 time=13.9 ms
64 bytes from maa03s22-in-f174.1e100.net (172.217.26.174): icmp_seq=2 ttl=117 time=13.7 ms
64 bytes from maa03s22-in-f174.1e100.net (172.217.26.174): icmp_seq=3 ttl=117 time=13.8 ms
64 bytes from maa03s22-in-f174.1e100.net (172.217.26.174): icmp_seq=4 ttl=117 time=13.7 ms

gping response:
image

Sorry, my screenshot tool is only taking the top left portion of the screen. The p95 is 1.56ms, which for my connection is impossible.

The same issue occurs with all other hosts.

Blinking / flashes

Can we do anything to remove flashes on refresh?
Maybe use a terminal command to move cursor to screen top instead of just prints?

0.1 todo

So there is a fair bit to do to get to a 0.1 release. Here's a list of things I can think of:

  • Look into Drawile (issue #6), seems to be a lot better than the homegrown stuff in gping at the moment.
  • Clean up the code. Actually document it and make it readable, probably need to sort out the wtfworthy x/y positioning stuff (sometimes bottom left is 0,0, sometimes top left).
  • Add proper command line arguments (issue #25)
  • Add a way to reset the graph, or make one/two huge ping spikes not make the graph scale daft (also I think the min number of graph dots is 2 for some reason)
  • Support ping whatever | gping
  • Possibly make the graph render on a timer rather than when receiving output from ping. Would fix the problem of not having a timeout message from some ping commands but would be more complex.

Run issue (No module named 'colorama')

$ pip3 install pinggraph
Collecting pinggraph
  Downloading pinggraph-0.0.4-py3-none-any.whl
Installing collected packages: pinggraph
Successfully installed pinggraph-0.0.4

$ gping ping.sunet.se
Traceback (most recent call last):
  File "/usr/local/bin/gping", line 7, in <module>
    from gping.pinger import run
  File "/usr/local/lib/python3.5/site-packages/gping/pinger.py", line 10, in <module>
    from colorama import Fore, init
ImportError: No module named 'colorama'

(OSX 10.11, python 3.5.0)

Terminate on `q`

Most interactive terminal applications (htop, iftop, nethogs, less) accept the convention of terminating when the user presses the q key.

Installation on Mac OS Sierra

Hi, i know this may be very basic, but would it be possible that you explain how to install gping on MacOS Sierra, i know the OS already have Python 2.6 Installed and I also downloaded and upgraded to 3.5. The "pip3 install pingggraph" works, but when I try to lauch it using "gping 8.8.8.8" it says "-bash: gping: command not found"

Thanks in advance.

Regards!

Add axis label

I've just discovered gping, and it's great. It would be even better if there were some simple axis label.

Also, is the current display linear or logarithmic?

gping snap fails under strict confinement

Thanks for making a snap of gping! It's pretty.

Unfortunately under strict confinement it fails. Looks like you need an extra plug and binary perhaps?

Traceback (most recent call last):
  File "/snap/gping/6/bin/gping", line 11, in <module>
    load_entry_point('pinggraph==1.0', 'console_scripts', 'gping')()
  File "/snap/gping/6/lib/python3.5/site-packages/gping/pinger.py", line 313, in run
    _run()
  File "/snap/gping/6/lib/python3.5/site-packages/gping/pinger.py", line 338, in _run
    for line in it(options):
  File "/snap/gping/6/lib/python3.5/site-packages/gping/pinger.py", line 251, in _inner
    ping = subprocess.Popen(args, stdout=subprocess.PIPE)
  File "/snap/gping/6/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/snap/gping/6/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg)
PermissionError: [Errno 13] Permission denied
alan@hal:~$ snappy-debug.security scanlog
sysctl: permission denied on key 'kernel.printk_ratelimit'
= AppArmor =
Time: Aug  3 01:40:37
Log: apparmor="DENIED" operation="open" profile="snap.gping.gping" name="/proc/24006/mounts" pid=24006 comm="python3" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
File: /proc/24006/mounts (read)
Suggestions:
* adjust program to not access '@{PROC}/@{pid}/mounts'
* add one of 'mount-observe, network-control' to 'plugs'

= AppArmor =
Time: Aug  3 01:40:37
Log: apparmor="DENIED" operation="exec" profile="snap.gping.gping" name="/bin/ping" pid=24022 comm="python3" requested_mask="x" denied_mask="x" fsuid=1000 ouid=0
File: /bin/ping (exec)
Suggestions:
* adjust snap to ship 'ping'
* adjust program to use relative paths if the snap already ships 'ping'

Use own mean() function.

Instead of using statistics.mean that breaks compatibility between python2 and python3, we can simply implement a mean(data) function that returns sum(data)/len(data)

I can send you a PR if you are okay with this.

gping only works in the local Network

If I start gping for local devices (192.168.1.*/24) it works fine.
but if I try such as gping google.com I get the following error.

Traceback (most recent call last):
  File "/usr/local/bin/gping", line 9, in <module>
    load_entry_point('pinggraph==1.0', 'console_scripts', 'gping')()
  File "/usr/local/lib/python2.7/dist-packages/gping/pinger.py", line 313, in run
    _run()
  File "/usr/local/lib/python2.7/dist-packages/gping/pinger.py", line 343, in _run
    plotted = plot(width, height, buff, host)
  File "/usr/local/lib/python2.7/dist-packages/gping/pinger.py", line 181, in plot
    u"โ–ˆ", column + 2, 2, 2 + bar_height, paint=_paint
  File "/usr/local/lib/python2.7/dist-packages/gping/pinger.py", line 72, in vertical_line
    self[column, y] = (next(data_iter), paint)
StopIteration

How can I make it work?
Thanks

'NoneType' object has no attribute 'group'

I get this error when I try to run gping on 64 bit Arch Linux.

Traceback (most recent call last):
  File "/usr/bin/gping", line 11, in <module>
    sys.exit(run())
  File "/usr/lib/python3.5/site-packages/gping/pinger.py", line 251, in run
    for ping in it(url):
  File "/usr/lib/python3.5/site-packages/gping/pinger.py", line 225, in _linux
    yield round(float(linux_re.search(line).group(1)))
AttributeError: 'NoneType' object has no attribute 'group'

Small latency causes division by zero

If you ping the default gateway over a low latency medium (LAN) you get latencies that result in a division by zero:

$ gping 192.168.1.1
Traceback (most recent call last):
  File "/mnt/Stuff/workplace/python/pinggraph/bin/gping", line 11, in <module>
    sys.exit(run())
  File "/mnt/Stuff/workplace/python/pinggraph/local/lib/python2.7/site-packages/gping/pinger.py", line 305, in run
    _run()
  File "/mnt/Stuff/workplace/python/pinggraph/local/lib/python2.7/site-packages/gping/pinger.py", line 331, in _run
    plotted = plot(width, height, buff, host)
  File "/mnt/Stuff/workplace/python/pinggraph/local/lib/python2.7/site-packages/gping/pinger.py", line 149, in plot
    yellow_zone_idx = round(max_scaled * (100 / max_ping))
ZeroDivisionError: float division by zero

gping crash when latency is 0 ms

When I try to ping a local address, I sometimes get 0 ms, and thus gping crashes with the following errormessage:

robert@ubuntu:~$ gping 192.168.0.2
Traceback (most recent call last):
  File "/home/robert/.local/bin/gping", line 11, in <module>
    sys.exit(run())
  File "/home/robert/.local/lib/python3.5/site-packages/gping/pinger.py", line 305, in run
    _run()
  File "/home/robert/.local/lib/python3.5/site-packages/gping/pinger.py", line 331, in _run
    plotted = plot(width, height, buff, host)
  File "/home/robert/.local/lib/python3.5/site-packages/gping/pinger.py", line 149, in plot
    yellow_zone_idx = round(max_scaled * (100 / max_ping))
ZeroDivisionError: division by zero

I restart gping a few times until the first echo response takes 1 or more ms, then gping starts and works as expected.

Add comparison to mtr (mytraceroute)

mtr also has graphs:
image

Though obviously they are of a different type (and aren't as pretty), they do convey some similar (though more detailed) information.

BTW, I would love an mtr that had an additional display mode that could switch among a set of gping-like graphs for each hop. /CC @traviscross & @rewolf

Detailed stats

Hi detailed stats are shown in the animated gif but there doesn't appear to be instructions as to how to enable them?

JT

Cannot install from git

Using master (commit b2aecf2) I get the following error when trying to run setup.py:

sudo ./setup.py
from: too many arguments
./setup.py: 4: ./setup.py: Syntax error: newline unexpected (expecting ")")

It's probably user error on the installation but snap and pip aren't an option for me.

Running Ubuntu 16.04.3 LTS x86-64
Python colorama 0.3.7 installed

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.