- This bash script strips the ping loss percentage figure which you can use for graphing purpose in MRTG, RRD or other graphing products.
#Purpose: Strip Ping loss percentage to fed into RRD
ping -c $cnt $host > $file
line=`grep "packet loss" $file`
line1=`echo $line | cut -d" " -f7`
loss=`basename $line1 %`
- Use low byte like 1byte data while pinging.
- If RTO occurs then it will take long time to execute script so better use less time to wait.
- Insted of ping use fping