Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Kaspars_Zibarts
Employee Employee
Employee

RX-DRP monitor

 

 

Whilst working on tuning our 23800 and 26000T performance issues I realised that couple of one-liners that are already available here in the community only provide cumulative statistics from time when counters were restarted and that might give inaccurate picture if some past event created RX drops that are not occurring anymore. So instead I wrote a script that evaluates "current" state by making two readings (set to 30mins apart but you can change it yourself) and then calculating drop rate based on diff

It's ugly as i had only 3 mins  to write it but does the trick. Note it reads RX-DRP counter only!

 

 

source /etc/profile.d/CP.sh
if [[ -e /etc/profile.d/vsenv.sh ]]; then
    source /etc/profile.d/vsenv.sh
    vsenv
fi

runme=true

if [ ! -f rxdrop.curr ]; then touch rxdrop.curr; fi

while $runme; do
  echo `date`
  mv rxdrop.curr rxdrop.prev
  netstat -ni | awk '{print $1" "$4" "$6}' | egrep "^bond|^eth" > rxdrop.curr
  while read line; do
    if_name=`echo "$line" | awk '{print $1}'`
    rx_tot_curr=`echo "$line" | awk '{print $2}'`
    rx_drp_curr=`echo "$line" | awk '{print $3}'`
    rx_tot_prev=`grep $if_name rxdrop.prev | awk '{print $2}'`
    rx_drp_prev=`grep $if_name rxdrop.prev | awk '{print $3}'`
    if [ ! $rx_tot_prev ]; then rx_tot_prev=0; fi
    if [ ! $rx_drp_prev ]; then rx_drp_prev=0; fi
    let diff_tot=rx_tot_curr-rx_tot_prev+1
    let diff_drp=rx_drp_curr-rx_drp_prev
    rate=`echo 100*$diff_drp/$diff_tot | bc -l`
    echo "$if_name ${rate:0:5}%" | sed 's/ \./ 0./'
  done < rxdrop.curr
  echo
  sleep 1800  # time in seconds
done

 

 

 

 

2020-10-21_10-04-01.jpg

 

2 Replies
Timothy_Hall
Champion
Champion

You can also use the expert mode command sar -n EDEV to see when network error counters were incremented for the last 30 days per interface, averaged out per second over 10-minute sampling periods:

sarnedev.png

Gateway Performance Optimization R81.20 Course
now available at maxpowerfirewalls.com
Kaspars_Zibarts
Employee Employee
Employee

awesome! thanks heaps!

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events