Another useful bash scrpt

  • This bash script strips the ping loss percentage figure which you can use for graphing purpose in MRTG, RRD or other graphing products.

#Date: 25-Jun-08
#Author: info[@]
#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 %`
echo $loss

Suggested Modification
  • 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


Post a Comment

Comments are moderated. No spam please.

Popular posts from this blog

Adobe Stand Alone Flash Player for Linux

Perm Root HTC Desire Gingerbread 2.3.3

[Solved] invalid partition table on /dev/sda -- wrong signature 0.