Gping - Ping, but with a graph

Related tags

Command-line gping
Overview

gping πŸš€

Crates.io Actions Status

Ping, but with a graph.

Table of Contents

Packaging status

Install πŸ’Ώ

  • macOS
  • Linux (Homebrew): brew install orf/brew/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.44.0 or greater): cargo install gping
  • Arch Linux: pacman -S gping
  • Ubuntu/Debian (Azlux's repo):
echo "deb http://packages.azlux.fr/debian/ buster main" | sudo tee /etc/apt/sources.list.d/azlux.list
wget -qO - https://azlux.fr/repo.gpg.key | sudo apt-key add -
sudo apt update
sudo apt install gping
sudo eselect repository enable dm9pZCAq
sudo emerge --sync dm9pZCAq
sudo emerge net-misc/gping::dm9pZCAq

Usage 🎷

Just run gping [host].

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

USAGE:
    gping [FLAGS] [OPTIONS] [hosts-or-commands]...

FLAGS:
        --cmd                Graph the execution time for a list of commands rather than pinging hosts
    -h, --help               Prints help information
    -4                       Resolve ping targets to IPv4 address
    -6                       Resolve ping targets to IPv6 address
    -s, --simple-graphics    Uses dot characters instead of braille
    -V, --version            Prints version information

OPTIONS:
    -b, --buffer <buffer>                    Determines the number of seconds to display in the graph. [default: 30]
    -n, --watch-interval <watch-interval>    Watch interval seconds (provide partial seconds like '0.5') [default: 0.5]

ARGS:
    <hosts-or-commands>...    Hosts or IPs to ping, or commands to run if --cmd is provided.
Comments
  • Not working on Ubuntu 19.10 ?

    Not working on Ubuntu 19.10 ?

    Hi, Installed it with cargo. (my os is 64 bit) when I do gping somehost I only see the blinking cursor in the top left. Normal ping works. Also tested it as root / with sudo. here is a demo video: https://youtu.be/RusyEIyL_K4

    opened by millsoft 18
  • Fails on FreeBSD 12.1

    Fails on FreeBSD 12.1

    thread '<unnamed>' panicked at 'Error pinging: Unsupported OS Unknown', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/gping-0.1.6/src/main.rs:122:33

    opened by Peter2121 16
  • gping fails due to GLIBC version problem

    gping fails due to GLIBC version problem

    The newest release (1.1.0) fails on older Linux systems with the following error:

    bridge ~/tmp [0:0]> gping bridge gping: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by gping)

    This on a CentOS 7.7 box with latest updates installed.

    CORRECTION: It's on CentOS 7.9 and affects also gping 1.0.1.

    opened by mjklemm 11
  • Use ringbuffer instead of using memcpy to shift element at EVERY PUSH

    Use ringbuffer instead of using memcpy to shift element at EVERY PUSH

    This introduces a data structure that replaces Vec<(f64, f64)> so that it does not perform a shift left at every push when its at full capacity. This should introduce performance benefits when the buffer is large enough. Additionally, this data structure performs better the larger the buffer size.

    Signed-off-by: Hanif Bin Ariffin [email protected]

    opened by hbina 10
  • Suggestion: inline mode

    Suggestion: inline mode

    Instead of full screen, it'd be awesome if gping could occupy like 7 lines of text, and remain visible after ^C. Then people could scroll up and skim data from earlier runs.

    I faked this screenshot: gping-inline-sketch

    opened by pmarks-net 6
  • gping only works in the local Network

    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

    opened by JPRuehmann 6
  • [Bug] test failure on i386 because of minor time difference

    [Bug] test failure on i386 because of minor time difference

    pinger got accepted into debian yesterday. Because of that I noticed that the some of the tests fails on the i386 arch because of minor time differences:

    
    running 10 tests
    test linux::tests::test_linux_detection ... ok
    test test::tests::alpine ... ok
    test test::tests::android ... ok
    test test::tests::debian ... ok
    test test::tests::dragonfly ... FAILED
    test test::tests::freebsd ... FAILED
    test test::tests::netbsd ... FAILED
    test test::tests::openbsd ... FAILED
    test test::tests::ubuntu ... FAILED
    test test::tests::macos ... FAILED
    
    failures:
    
    ---- test::tests::dragonfly stdout ----
    thread 'test::tests::dragonfly' panicked at 'assertion failed: `(left == right)`
      left: `"110.394ms"`,
     right: `"110.395ms"`: Failed at idx 3', src/test.rs:31:17
    stack backtrace:
       0: rust_begin_unwind
                 at /usr/src/rustc-1.63.0/library/std/src/panicking.rs:584:5
       1: core::panicking::panic_fmt
                 at /usr/src/rustc-1.63.0/library/core/src/panicking.rs:142:14
       2: core::panicking::assert_failed_inner
       3: core::panicking::assert_failed
                 at /usr/src/rustc-1.63.0/library/core/src/panicking.rs:181:5
       4: pinger::test::tests::test_parser
                 at ./src/test.rs:31:17
       5: pinger::test::tests::dragonfly
                 at ./src/test.rs:55:9
       6: pinger::test::tests::dragonfly::{{closure}}
                 at ./src/test.rs:54:5
       7: core::ops::function::FnOnce::call_once
                 at /usr/src/rustc-1.63.0/library/core/src/ops/function.rs:248:5
       8: core::ops::function::FnOnce::call_once
                 at /usr/src/rustc-1.63.0/library/core/src/ops/function.rs:248:5
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    
    ---- test::tests::freebsd stdout ----
    thread 'test::tests::freebsd' panicked at 'assertion failed: `(left == right)`
      left: `"110.394ms"`,
     right: `"110.395ms"`: Failed at idx 3', src/test.rs:31:17
    stack backtrace:
       0: rust_begin_unwind
                 at /usr/src/rustc-1.63.0/library/std/src/panicking.rs:584:5
       1: core::panicking::panic_fmt
                 at /usr/src/rustc-1.63.0/library/core/src/panicking.rs:142:14
       2: core::panicking::assert_failed_inner
       3: core::panicking::assert_failed
                 at /usr/src/rustc-1.63.0/library/core/src/panicking.rs:181:5
       4: pinger::test::tests::test_parser
                 at ./src/test.rs:31:17
       5: pinger::test::tests::freebsd
                 at ./src/test.rs:50:9
       6: pinger::test::tests::freebsd::{{closure}}
                 at ./src/test.rs:49:5
       7: core::ops::function::FnOnce::call_once
                 at /usr/src/rustc-1.63.0/library/core/src/ops/function.rs:248:5
       8: core::ops::function::FnOnce::call_once
                 at /usr/src/rustc-1.63.0/library/core/src/ops/function.rs:248:5
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    
    ---- test::tests::netbsd stdout ----
    thread 'test::tests::netbsd' panicked at 'assertion failed: `(left == right)`
      left: `"110.394ms"`,
     right: `"110.395ms"`: Failed at idx 3', src/test.rs:31:17
    stack backtrace:
       0: rust_begin_unwind
                 at /usr/src/rustc-1.63.0/library/std/src/panicking.rs:584:5
       1: core::panicking::panic_fmt
                 at /usr/src/rustc-1.63.0/library/core/src/panicking.rs:142:14
       2: core::panicking::assert_failed_inner
       3: core::panicking::assert_failed
                 at /usr/src/rustc-1.63.0/library/core/src/panicking.rs:181:5
       4: pinger::test::tests::test_parser
                 at ./src/test.rs:31:17
       5: pinger::test::tests::netbsd
                 at ./src/test.rs:65:9
       6: pinger::test::tests::netbsd::{{closure}}
                 at ./src/test.rs:64:5
       7: core::ops::function::FnOnce::call_once
                 at /usr/src/rustc-1.63.0/library/core/src/ops/function.rs:248:5
       8: core::ops::function::FnOnce::call_once
                 at /usr/src/rustc-1.63.0/library/core/src/ops/function.rs:248:5
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    
    ---- test::tests::openbsd stdout ----
    thread 'test::tests::openbsd' panicked at 'assertion failed: `(left == right)`
      left: `"110.394ms"`,
     right: `"110.395ms"`: Failed at idx 3', src/test.rs:31:17
    stack backtrace:
       0: rust_begin_unwind
                 at /usr/src/rustc-1.63.0/library/std/src/panicking.rs:584:5
       1: core::panicking::panic_fmt
                 at /usr/src/rustc-1.63.0/library/core/src/panicking.rs:142:14
       2: core::panicking::assert_failed_inner
       3: core::panicking::assert_failed
                 at /usr/src/rustc-1.63.0/library/core/src/panicking.rs:181:5
       4: pinger::test::tests::test_parser
                 at ./src/test.rs:31:17
       5: pinger::test::tests::openbsd
                 at ./src/test.rs:60:9
       6: pinger::test::tests::openbsd::{{closure}}
                 at ./src/test.rs:59:5
       7: core::ops::function::FnOnce::call_once
                 at /usr/src/rustc-1.63.0/library/core/src/ops/function.rs:248:5
       8: core::ops::function::FnOnce::call_once
                 at /usr/src/rustc-1.63.0/library/core/src/ops/function.rs:248:5
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    
    ---- test::tests::ubuntu stdout ----
    thread 'test::tests::ubuntu' panicked at 'assertion failed: `(left == right)`
      left: `"19.399ms"`,
     right: `"19.4ms"`: Failed at idx 2', src/test.rs:31:17
    stack backtrace:
       0: rust_begin_unwind
                 at /usr/src/rustc-1.63.0/library/std/src/panicking.rs:584:5
       1: core::panicking::panic_fmt
                 at /usr/src/rustc-1.63.0/library/core/src/panicking.rs:142:14
       2: core::panicking::assert_failed_inner
       3: core::panicking::assert_failed
                 at /usr/src/rustc-1.63.0/library/core/src/panicking.rs:181:5
       4: pinger::test::tests::test_parser
                 at ./src/test.rs:31:17
       5: pinger::test::tests::ubuntu
                 at ./src/test.rs:70:9
       6: pinger::test::tests::ubuntu::{{closure}}
                 at ./src/test.rs:69:5
       7: core::ops::function::FnOnce::call_once
                 at /usr/src/rustc-1.63.0/library/core/src/ops/function.rs:248:5
       8: core::ops::function::FnOnce::call_once
                 at /usr/src/rustc-1.63.0/library/core/src/ops/function.rs:248:5
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    
    ---- test::tests::macos stdout ----
    thread 'test::tests::macos' panicked at 'assertion failed: `(left == right)`
      left: `"33.897ms"`,
     right: `"33.898ms"`: Failed at idx 2', src/test.rs:31:17
    stack backtrace:
       0: rust_begin_unwind
                 at /usr/src/rustc-1.63.0/library/std/src/panicking.rs:584:5
       1: core::panicking::panic_fmt
                 at /usr/src/rustc-1.63.0/library/core/src/panicking.rs:142:14
       2: core::panicking::assert_failed_inner
       3: core::panicking::assert_failed
                 at /usr/src/rustc-1.63.0/library/core/src/panicking.rs:181:5
       4: pinger::test::tests::test_parser
                 at ./src/test.rs:31:17
       5: pinger::test::tests::macos
                 at ./src/test.rs:45:9
       6: pinger::test::tests::macos::{{closure}}
                 at ./src/test.rs:44:5
       7: core::ops::function::FnOnce::call_once
                 at /usr/src/rustc-1.63.0/library/core/src/ops/function.rs:248:5
       8: core::ops::function::FnOnce::call_once
                 at /usr/src/rustc-1.63.0/library/core/src/ops/function.rs:248:5
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    
    
    failures:
        test::tests::dragonfly
        test::tests::freebsd
        test::tests::macos
        test::tests::netbsd
        test::tests::openbsd
        test::tests::ubuntu
    
    test result: FAILED. 4 passed; 6 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s
    

    This looks like a bug to me as all other arches don't have this problem. I'd suggest to maybe even add a [#cfg] macro to run the bsd/macos test only on their respective platform.

    opened by werdahias 5
  • Is it installable on Debian bullseye?

    Is it installable on Debian bullseye?

    Hello, I'm sorry if my question seems silly but, in the installation doc the repository is "buster", does that mean that qping can't be installed on "bullseye"?

    image

    Thx

    opened by EVOTk 5
  • Build failed on Debian Buster (amd64)

    Build failed on Debian Buster (amd64)

    $ cargo install gping

    error[E0658]: use of unstable library feature 'matches_macro'
      --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.12.0/src/backend/crossterm.rs:58:17
       |
    58 |             if !matches!(last_pos, Some(p) if x == p.0 + 1 && y == p.1) {
       |                 ^^^^^^^
       |
       = note: for more information, see https://github.com/rust-lang/rust/issues/65721
    
    error[E0599]: no associated item named `MAX` found for type `usize` in the current scope
       --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.12.0/src/buffer.rs:275:47
        |
    275 |         self.set_stringn(x, y, string, usize::MAX, style);
        |                                               ^^^ associated item not found in `usize`
        |
    help: you are looking for the module in `std`, not the primitive type
        |
    275 |         self.set_stringn(x, y, string, std::usize::MAX, style);
        |                                        ^^^^^^^^^^^^^^^
    
    error: aborting due to 2 previous errors
    
    Some errors have detailed explanations: E0599, E0658.
    For more information about an error, try `rustc --explain E0599`.
    error: could not compile `tui`.
    warning: build failed, waiting for other jobs to finish...
    error: failed to compile `gping v0.1.7`, intermediate artifacts can be found at `/tmp/cargo-install5Kz6Qu`
    
    Caused by:
      build failed
    
    opened by CompuRoot 5
  • Mac : brew install failed

    Mac : brew install failed

    ~ brew install gping ==> Searching for similarly named formulae... Error: No similarly named formulae found. Error: No available formula or cask with the name "gping". ==> Searching for a previously deleted formula (in the last month)... Error: No previously deleted formula found. ==> Searching taps on GitHub... Error: No formulae found in taps.

    try brew tap also failed

    opened by zcwfeng 5
  • Cannot install from git

    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

    opened by TragicWarrior 5
  • Fix rendering readme for crates.io

    Fix rendering readme for crates.io

    I noticed that gping crate page wasn't showing the readme. I looked at the serde source tree and they handle it like this so should work here too in theory.

    opened by icp1994 0
  • cannot resolve error when attempting to ping an IPv6 address

    cannot resolve error when attempting to ping an IPv6 address

    I'm fairly sure this was working before, it appears a recent version of gping broke the ability to ping IPv6 addresses.

    For example running the command:

    gping 2001:db8::1
    

    It responds with the error:

    There was an error running ping: exit status: 68
                                                    Stderr: ping: cannot resolve 2001:db8::1: Unknown host
    

    I'm running version 1.6.3

    gping 1.6.3
    commit_hash: 
    build_time: 2022-12-20 21:21:34 +00:00
    build_env: rustc 1.65.0,
    
    opened by artooro 2
  • pinger argument unparsing unsoundness

    pinger argument unparsing unsoundness

    For Reasons I was looking at the source code for this crate, and I found code like this:

        fn ping_args(&self, target: String) -> Vec<String> {
    ...
            if let Some(interface) = &self.interface {
                args.push("-I".into());
                args.push(interface.clone());
            }
            args.push(target);
    

    This is unsound, because if target starts with a - it will be interpreted by ping as an option. (By unsound I mean this: if this API is passed untrusted input, undesirable malfunctions, which might be security relevant, can occur.)

    I don't think this is very exploitable, on Linux at least, because almost all of the options also require a target, which when this malfunction occurs won't be supplied. The worst that can be done seems to be to pass -V or -h and cause the rest of the pinger library to try to parse the help or version output, which will be a malfunction, but fairly harmless.

    I suggest that the ping_args function ought to take something like target: SyntaxCheckedTargetHost (with struct SyntaxCheckedTargetHost(String) and then in the common code you would check that the thing starts with an alphanumeric or [ or : when constructing the SyntaxCheckedTargetHost.

    Thanks,.

    opened by ijackson 0
  • Graph seems to be not accurate

    Graph seems to be not accurate

    Hello,

    I don't know what to trust, but the gping shows something different than ping command with 0.25s interval From what I understand when there is no response from the server for about 2s Gping adjust chart to that timeframe but then it does not go back displaying 300ms as few seconds latency. Gping version 1.3.1

    Here is the Video showing the problem the problem starts at 0:45 https://youtu.be/nMdM5CtExrU

    opened by Frambooisier 0
  • "Max" appears to be unrelated to the actual graph

    image

    According to this the "max" is 37ms, but looking at the graph we can clearly see several spikes up into 50ms range. The demo gif in the README.md has this same problem.

    opened by jwalton 2
Releases(gping-v1.6.3)
Owner
Tom Forbes
Django person living and working in London.
Tom Forbes
Core lightning (CLN) plugin to watch channel health, gossip health and ping amboss for online status

vitality Core lightning (CLN) plugin to watch channel health, gossip health and ping amboss for online status Installation Building Usage Telegram Opt

null 4 Oct 6, 2023
The module graph logic for Deno CLI

deno_graph The module graph/dependency logic for the Deno CLI. This repository is a Rust crate which provides the foundational code to be able to buil

Deno Land 67 Dec 14, 2022
Red-blue graph problem solver - Rust implementation

Red-blue graph problem solver - Rust implementation The problem is the following: In a directed graph, each node is colored either red or blue. Furthe

Thomas PrΓ©vost 2 Jan 17, 2022
A general-purpose, transactional, relational database that uses Datalog and focuses on graph data and algorithms

cozo A general-purpose, transactional, relational database that uses Datalog for query and focuses on graph data and algorithms. Features Relational d

null 1.9k Jan 9, 2023
World's first, but possibly worst, blinky for the pico in Rust

pico-blink-rs Running Rust code on the Raspberry Pi Pico Booting The RP2040 has external QSPI flash. There is an internal mask-ROM bootloader which ca

rp-rs 129 Dec 24, 2022
du + rust = dust. Like du but more intuitive.

Dust du + rust = dust. Like du but more intuitive. Why Because I want an easy way to see where my disk is being used. Demo Install Cargo cargo install

andy.boot 5.4k Jan 4, 2023
a simple program that you can scrap, is shit and really simple but is cool.

if you want to run it you need to have installed curl by default scrap youtube, but you can change it, also change the number of threads and run: carg

pai 7 Oct 15, 2021
Rmatrix is similar to the cmatrix, but it wrote it in Rust.

Rmatrix is similar to the cmatrix, but it wrote it in Rust. Get up to 75% performance improvement compared to cmatrix.

null 8 Apr 8, 2022
Like grep, but uses tree-sitter grammars to search

tree-grepper Works like grep, but uses tree-sitter to search for structure instead of strings. Installing This isn't available packaged anywhere. That

Brian Hicks 219 Dec 25, 2022
Zenith - sort of like top or htop but with zoom-able charts, CPU, GPU, network, and disk usage

Zenith - sort of like top or htop but with zoom-able charts, CPU, GPU, network, and disk usage

Benjamin Vaisvil 1.6k Jan 4, 2023
A command-line shell like fish, but POSIX compatible.

A command-line shell like fish, but POSIX compatible.

Seiya Nuta 813 Dec 29, 2022
A cli based pastebin in Rust, but very insecure

pasta A cli based pastebin in Rust, but very insecure Use nightly toolchain to build rustup override set nightly When this program is running, you can

Snehit Sah 3 Mar 25, 2022
A trash-cli copy, but this time in Rust.

trash-rs A trash-cli copy, but this time in Rust. TODO Deletion Relative paths * functionality List files Include in Metadata: Original directory Date

null 1 Nov 23, 2021
A system clipboard command line tools which inspired by pbcopy & pbpaste but better to use.

rclip A command line tool which supports copy a file contents to the system clipboard or copy the contents of the system clipboard to a file. Install

yahaa 3 May 30, 2022
`nm` and `addr2line` but for DI "debug-info" COFF files

Summary This is a very simple tool that prints out function, global, and source line information from a .dbg "DI" COFF debug file. This can handle bot

null 7 Dec 18, 2022
Codemod - Codemod is a tool/library to assist you with large-scale codebase refactors that can be partially automated but still require human oversight and occasional intervention

Codemod - Codemod is a tool/library to assist you with large-scale codebase refactors that can be partially automated but still require human oversight and occasional intervention. Codemod was developed at Facebook and released as open source.

Meta Archive 4k Dec 29, 2022
Hilbert curve but in Rust for j2kun/pmpf-code

About this code This repository contains code for matrix multiplication using Hilbert Curves. The original code (2) is part of @j2kun's code for his n

Christoph Siedentop 1 Jan 10, 2022
A lightweight but incredibly powerful and feature-rich BitTorrent tracker. Supports UDP + HTTP(S) and a private tracker mode.

Torrust Tracker Project Description Torrust Tracker is a lightweight but incredibly powerful and feature-rich BitTorrent tracker made using Rust. Feat

Torrust 162 Dec 31, 2022
yet another typing test, but crab flavoured

toipe A trusty terminal typing tester for the tux. Usage Install cargo install toipe Run typing test toipe looks best on a nice terminal (such as Ala

Samyak Sarnayak 431 Dec 20, 2022