Coder Social home page Coder Social logo

python-ping's Introduction

python-ping's People

Contributors

samuel 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

python-ping's Issues

Python version

Was this program made to run on python 2.7 or 3? There's some syntax problem going on and I have no idea if this is because of the version or what. I'm really thankful if you could help me with this. Thank's!

Two questions

Hi @samuel

I would like to use this package to monitor some interfaces using ICMP. A possible scenario is:
a batch of 15 pings executed every 3 seconds (3 seconds delay between two consecutive batches). However pyping, without forcing a specific timeout value, is not possible to do so, because would needs some enhancements:

  • bind to a specific source IP address
  • parallel or rapid asynchronous pings

Is any of the above on your bucket list at the moment?

Cheers,
Mircea

Incorrect packet length due to padding encoding

hi,

I noticed that the packets sent in pyping are way too big. After some investigation I found out the padding is 4x larger than expected. It looks like the encoding will add 4 bytes to the datagram for every int in the padBytes array.

I fixed this by changing 'data = bytes(padBytes)' to 'str(bytearray(padBytes))' in /pyping/core.py function 'send_one_ping'.

I understand that bytearray is only available since python 2.6, so to preserve backward compatibility, you may want to use a slightly different method.

I use python 2.7.17 by the way.

regards,
/steven

ps; sorry if i did not put a savvy diff in here. i'm new to this.

Python3 about win32

we can't run in windows

D:\Program Files\Python3>python ping_new1.py
ping_new1.py:168: DeprecationWarning: time.clock has been deprecated in Python 3.3 and will be removed from Python 3.8: use time.perf_counter or time.process_time instead
data = struct.pack("d", default_timer()) + data.encode()
ping_new1.py:130: DeprecationWarning: time.clock has been deprecated in Python 3.3 and will be removed from Python 3.8: use time.perf_counter or time.process_time instead
startedSelect = default_timer()
ping_new1.py:132: DeprecationWarning: time.clock has been deprecated in Python 3.3 and will be removed from Python 3.8: use time.perf_counter or time.process_time instead
howLongInSelect = (default_timer() - startedSelect)
ping 'heise.de' ... Timeout > 2s
ping 'heise.de' ... Timeout > 2s
ping 'heise.de' ... Timeout > 2s
ping 'heise.de' ... Timeout > 2s
ping 'baidu.com' ... Timeout > 2s
ping 'baidu.com' ... Timeout > 2s
ping 'baidu.com' ... Timeout > 2s
ping 'baidu.com' ... Timeout > 2s

I have much time to solve this problem, I need your help! Thanks !

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.