Python Forum

Full Version: ping program in python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i want to write a new ping program in python. but i want it to differ from the classic ping program in the following ways:

1. timing that does not accumulate offsets or errors. this means that for each event this program does, it first determine when the event should happen, then calculates the time interval to the next event.

2. it should accept multiple addresses and ping them in ordered rotation or random select with a consistent spread of the addresses of the of rotation. it should be possible to specify the interval of time between each rotation cycle.

3. it should be able to use a number of methods to ping a remote host, such as ICMP or UDP or TCP.

4. it should be able to decide if a remote host is up or down reliably based on a number of ways and take an action when the condition is met.
Most of the servers don't respond to ICMP requests. Checking if the server is down is better to be done by requesting for a service on some port and see the response status code.
(Jun-23-2018, 10:42 AM)wavic Wrote: [ -> ]Most of the servers don't respond to ICMP requests. Checking if the server is down is better to be done by requesting for a service on some port and see the response status code.
i'm sure i'd know whether or not my servers are responding to ICMP echo requests within my networks. BTW, i have noticed that some ISPs and many business networks discard outbound (at their border) ICMP echo requests. that might be a common cause of the issue. still, i see a majority of servers do respond. and this is why i plan to have various other options to "ping" another host, including DNS and other protocol based requests. and i may also want to only consider timely responses and a consistent sequence of responses as "up".