Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

License

NotificationsYou must be signed in to change notification settings

laixintao/pingtop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 usingclick. Check help infowithpingtop -h.

~ pingtop --helpUsage: 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 getPermission denied ?

We use ICMP socket to send ping packet withoutsudo (Seethispostby lilydjwg(in Chinese)), however, who(which group) can use this featureis controled by a kernel parameter:net.ipv4.ping_group_range.

cat /proc/sys/net/ipv4/ping_group_range1    0

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

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

[vagrant@centos7 pingtop]$ iduid=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 referping.py.
  • The UI was built onpanwidthanks to @tonycpsu.
  • @gzxultra helped to solve thepermission issues.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp