#############Script content is as follows##############
#!/bin/bash ## action: monitoring traffic eth0 port ## may be changed to other ports ## eth0 eth1 oF like: Barlow ## 2012-12-10 # take the initial flow rate value R1 = `cat /sys /class /net /eth0 /Statistics/rx_bytes`T1=`cat /sys/class/net/eth0/statistics/tx_bytes`## Pause for 10 seconds and then take the value again sleep 10R2=`cat /sys/class/net/eth0/statistics/rx_bytes`T2= `cat /sys/class/net/eth0/statistics/tx_bytes`##Calculate the average flow value in 10 seconds in kb/s TBPS=`expr $T2 - $T1`RBPS=`expr $R2 - $R1 ## The following 10240 represents 10 seconds multiplied by 1024TKBPS=`expr $TBPS /10240`RKBPS=`expr $RBPS /10240`echo "Upload rate eth0: $TKBPS kb/s Download rate eth1: $RKBPS kb/s at $(date +%Y%m%d%H:%M:%S)" >> /home/barlow/shell/network_$(date +%Y%m%d).log#### ######## After executing 3 times, the log is as follows ##############
#cat /home/barlow/shell/network_$(date +%Y %m%d).log upload rate eth0: 12 kb/s download rate eth0: 166 kb/s at 2013031912:16:03 upload rate eth0: 10 kb/s Upload rates eth0: 60 kb /s at 2013031912: 16: 39 upload rate eth0: 12 kb /s download rate eth0: 81 kb /s at 2013031912: 17: 14
view mysql default encoding format show variables like “character%”; If the reality-bash
When compiling the program today, the error: storage class specified for parameter is not found in
disk partitioning under Linux, file system formatting and raid devicecomparing disk partition format
The Linux operating system is an open source, free operating system that is not only secure, stable,
VMware Workstation Installs Linux System
Ordinary users under Linux can not directly use crontab problem
Linux system and 20 points difference with Windows
Kdump and crash configuration methods and failure analysis methods
Resource Sharing between Windows and Linux
Check Hard drive for bad sectors or bad blocks in linux
Use the awk command to find hidden superusers and passwords in the system.
Detailed process for opening Telnet service on Linux system
Easy access to WIN7 administrator privileges, from farmers to landlords
WP8.1 Notification Center officially confirmed
Five Windows 7 suspended animation scenarios and processing methods
WinXP can't create a solution for VPN connection
How to use winadmin administrator account to log in
Historical Windows system configuration big PK: minimum 256KB memory only
(Figure) new windows 10 Build 10074 leaked