Ping test script
#! /Bin/bashlistpoliciplist.txt log = Ping. logecho-n ""> $ log # clear historical log grep-V "#" $ list | grep-V "^ $">. list # Read the IP address list from the $ list file, remove the rows and empty rows that contain #, and write the results. listwhile read ipdo echo "$ ip' Ping-S 1000-F-C 100 $ IP | grep transmitted | awk '{print $6}'' ">>$ logdone <. list # From. list reads IP addresses and performs Ping detection grep-V "0%" $ logrm. list
The Ping parameter-s specifies the ICMP packet size,-C specifies the number of Ping packets, and-F specifies the non-segmentation flag in the packets.
Man Ping describes the-F parameter as follows:
-F: flood Ping. for every echo_request sent a period ''. ''is printed, while for ever echo_reply encrypted ed a backspace is printed. this provides a rapid display of how many packets are being dropped. if interval is not given, it sets interval to zero and outputs packets as fast as they come back or one hundred times per second, whichever is more. only the super-user may use this option with zero interval.
This article is from the foolishfish blog, please be sure to keep this source http://foolishfish.blog.51cto.com/3822001/1566845
Batch Ping test script