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

Squid Access.log Meaning Explained

Logging Handler With Buffering And Uses Amazon SES For Python

Send SMS Using Gammu Command Line Tool