Tag Archives: continuous ping

Pinging host for a lot of time

TL;DR: use this program to track if a host up or down using ping.

Sometimes for some kind of a check, I need to ping a host for a lot of time and see when the ping wasn’t successful. The familiar ping program doesn’t fit that purpose. Ping’s lines will scroll back, and if at some point ping will be unsuccessful, there is no way to know when it happened.

I searched google for a program that will log pings and tell when they were successful and when they were not. Found some for free and some programs that costs money.

I created a simple python script that will do just that. In addition I compiled the script to executable file for windows.

The program will ping destination and print the time when the ping was successful or not. After that it will print every time the destination changes it’s status. Output example:

./pinger.py -s 10.0.2.31
Tracking 10.0.2.31:
system 10.0.2.31 up at 2018-04-02 10:37:05.976400
system 10.0.2.31 down at 2018-04-02 10:37:19.039902
system 10.0.2.31 up at 2018-04-02 10:37:26.063647

The program source code and executable file can be downloaded from my github page.

https://github.com/timgold81/pingtrack