Page 1 of 1

How to hide "icmp_seq" from ping?

Posted: 2016/05/18 18:25:25
by Kunwar
I am trying to setup my server to ping two computer with time stamp so I can check the ping stats later against any event... and since this ping request will be running for weeks I want to hide "icmp_seq" cuz it will grow to a very large number is few days. I tried searching the manual but found nothing helpful.... how will it be done?

so far I have been successful in catching the result of the ping though some bash scripting but I am not sure how to remove the particular part that I want to omit.

Code: Select all

ping localhost | while read row; do echo $row ;done
ping localhost | while read row; do { echo "${row%: *}" ;} done

Re: How to hide "icmp_seq" from ping?

Posted: 2016/05/18 18:30:26
by gerald_clark
Just run "ping -c othersite >> mylogfile" every minute, or 10 seconds, or whatever is most useful.

Re: How to hide "icmp_seq" from ping?

Posted: 2016/05/18 18:46:47
by Kunwar
I cant do it this way cuz I want to keep it live as well but thanks for the suggestion.

Re: How to hide "icmp_seq" from ping?

Posted: 2016/05/18 19:19:39
by TrevorH
If you're looking for missing packets then the icmp_seq is sort of essential to see which ones were dropped.

Sounds more like you're trying to reinvent mtr

Re: How to hide "icmp_seq" from ping?

Posted: 2016/05/18 19:24:03
by Kunwar
You got a point... I think I shouldn't be doing it.