Skip to content
Track host using ping and display time when it went up or down
Python
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
pinger.exe
pinger.py

README.md

pingtrack

Use ping to log the time when a host went up or down

usage: pinger.py [-h] [-s HOST] [-d DOWN] [-o DOWN_INTERVAL] [-u UP_INTERVAL]

Ping tracker of a host. Shows the time when the host went UP or DOWN

optional arguments:
  -h, --help            show this help message and exit
  -s HOST, --host HOST  Host name or IP address. Default = 8.8.8.8
  -d DOWN, --down DOWN  How many pings get lost, until the host declared as
                        DOWN. Default=3
  -o DOWN_INTERVAL, --down_interval DOWN_INTERVAL
                        Interval between pings when host is down. Default=1
  -u UP_INTERVAL, --up_interval UP_INTERVAL
                        Interval between pings when host is up. Default=1

  To stop monitoring press CTRL+C

Example

tim@tim-stat:~/python/pingtrack$ ./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
ctrl+C
Stopping pinger. Thanks for using.
Please visit https://github.com/timgold81/
contact timgold@gmail.com
You can’t perform that action at this time.