########################################################################################## # # Ver (2013-08-02) netmonitor.sh # ##########################################################################################
#!/bin/ksh export interface=$1 if [ "$interface" == "" ] then echo No adapter name given echo Usage: netmonitor.sh echo Example: ./netmonitor.sh entX exit fi
let deltarbytes=$(echo "($newrbytes-$oldrbytes)/1024/1024/120"|bc) let deltawbytes=$(echo "($newwbytes-$oldwbytes)/1024/1024/120"|bc)
############################### large than 1024/8*4*0.7 ################################## if [ $deltarbytes -gt 358 ] || [ $deltawbytes -gt 358 ] then date >> $SYS_FILE echo "Exceeds the net_traffic threshold : MB-Out:$deltarbytes MB-In:$deltawbytes" >> $SYS_FILE fi