Giter Site home page Giter Site logo

cnawel / pingtop Goto Github PK

View Code? Open in Web Editor NEW

This project forked from laixintao/pingtop

0.0 0.0 0.0 183 KB

🏓Ping multiple servers and show results in a top-like terminal UI.

Home Page: https://pypi.org/project/pingtop/

License: MIT License

Python 100.00%

pingtop's Introduction

pingtop

Ping multiple servers and show the result in a top like terminal UI.

asciicast

Install

pip install pingtop

** pingtop support Python3.8 Python3.8. **

There is a dependency (blist <http://stutzbachenterprises.com/blist/>) not supporting Python3.9, so please pingtop can't support 3.9.

Usage

Then ping mutiple server:

pingtop baidu.com google.com twitter.com

This project is using click. Check help info with pingtop -h.

~ pingtop --help
Usage: pingtop [OPTIONS] [HOST]...

Options:
  -s, --packetsize INTEGER        specify the number of data bytes to be sent.
                                  The default is 56, which translates into 64
                                  ICMP data bytes when combined with the 8
                                  bytes of ICMP header data.  This option
                                  cannot be used with ping sweeps.  [default:
                                  56]
  -l, --logto PATH
  -v, --log-level [DEBUG|INFO|WARNING|ERROR|CRITICAL]
  --help                          Show this message and exit.

Why do I get Permission denied ?

We use ICMP socket to send ping packet without sudo (See this post by lilydjwg(in Chinese)), however, who(which group) can use this feature is controled by a kernel parameter: net.ipv4.ping_group_range.

cat /proc/sys/net/ipv4/ping_group_range

1    0

The default value is 1 0, this means the whose group number from 1 to 0 can use this feature(which means nobody can use this), so you get a Permission denied .

To fix this, change this variable to a proper range include your group id, like this:

[vagrant@centos7 pingtop]$ id
uid=1000(vagrant) gid=1000(vagrant) groups=1000(vagrant) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

[vagrant@centos7 pingtop]$ sudo sysctl -w net.ipv4.ping_group_range='0 1001'
net.ipv4.ping_group_range = 0 1001

Credits

  • For the credits of ping.py’s implementation please refer ping.py.
  • The UI was built on panwid thanks to @tonycpsu.
  • @gzxultra helped to solve the permission issues.

pingtop's People

Contributors

laixintao avatar gzxultra avatar ivanhercaz avatar quintonamore avatar rsharifnasab avatar jasonqiao36 avatar

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.