ping with time and log

Usage:

Download the ping.sh file. Unpack it and start it in with ./ping.sh (don’t forget to be in the right folder). The script will ping google (8.8.8.8, if you do not change it in the script) and will create an „log“ file with the default name „tping“ in the same folder.

The output should look like this: (if you have a working connection to the host)
Mon Jun 12 12:17:41 CEST 2017: 64 bytes from 8.8.8.8: icmp_seq=0 ttl=46 time=28.139 ms

It will look like this if your connection is not working or the server could not be reached
Mon Jun 12 12:17:41 CEST 2017: Request timeout for icmp_seq 0

The ping time depends if you ping some device in your own network or in the internet.
If it is in the internet:
0-30 ms -> GOOD
30 – 80 ms -> OK
80-120 ms -> Mhhhhh
120 > -> go out and do something else 😉

WAN

Example Ping into the wan

64 bytes from 8.8.8.8: icmp_seq=1 ttl=47 time=18.991 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=47 time=18.917 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=47 time=18.961 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=47 time=18.893 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=47 time=18.932 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=47 time=19.114 ms

If it is in you network (LAN – Cable)
0-15 ms -> GOOD
15-50 ms -> OK
50 ms > you should have a look why this is so slow (maybe your destination is under heavy network traffic or you are, or some device in between)

LAN – Cable Network

Example Ping in the local network

64 bytes from 172.100.10.20: icmp_seq=1 ttl=128 time=0.236 ms
64 bytes from 172.100.10.20: icmp_seq=2 ttl=128 time=0.140 ms
64 bytes from 172.100.10.20: icmp_seq=3 ttl=128 time=0.161 ms
64 bytes from 172.100.10.20: icmp_seq=4 ttl=128 time=0.151 ms
64 bytes from 172.100.10.20: icmp_seq=5 ttl=128 time=0.161 ms
64 bytes from 172.100.10.20: icmp_seq=6 ttl=128 time=0.153 ms

WLan – Wireless Network

Example Ping in the local network

64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=15.531 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=3.515 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=14.879 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=6.182 ms
64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=7.358 ms
64 bytes from 192.168.1.1: icmp_seq=6 ttl=64 time=5.746 ms

 

System:

Linux & Mac

#!/bin/bash
#example: Mon Jun 12 12:17:41 CEST 2017: 64 bytes from 8.8.8.8: icmp_seq=0 ttl=46 time=28.139 ms

server="8.8.8.8"
log="tping"

ping $server | while read pong; do echo "$(date): $pong"; done >> $log.txt

Download File: ping.sh

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Time limit is exhausted. Please reload the CAPTCHA.

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.