Linux下统计高速网络中的流量
netpps.sh统计每秒数据量,包含接收(RX)或发送(TX)
netpps.sh eth0
#!/bin/bash INTERVAL="" # update interval in seconds if [ -z "$1" ]; then
echo
echo usage: $ [network-interface]
echo
echo e.g. $ eth0
echo
echo shows packets-per-second
exit
fi IF=$ while true
do
R1=`cat /sys/class/net/$/statistics/rx_packets`
T1=`cat /sys/class/net/$/statistics/tx_packets`
sleep $INTERVAL
R2=`cat /sys/class/net/$/statistics/rx_packets`
T2=`cat /sys/class/net/$/statistics/tx_packets`
TXPPS=`expr $T2 - $T1`
RXPPS=`expr $R2 - $R1`
echo "TX $1: $TXPPS pkts/s RX $1: $RXPPS pkts/s"
done
netpps.sh
netspeed.sh描述网络传输中的接收(RX)发送(TX)带宽
netspeed.sh eth0
#!/bin/bash INTERVAL="" # update interval in seconds if [ -z "$1" ]; then
echo
echo usage: $ [network-interface]
echo
echo e.g. $ eth0
echo
exit
fi IF=$ while true
do
R1=`cat /sys/class/net/$/statistics/rx_bytes`
T1=`cat /sys/class/net/$/statistics/tx_bytes`
sleep $INTERVAL
R2=`cat /sys/class/net/$/statistics/rx_bytes`
T2=`cat /sys/class/net/$/statistics/tx_bytes`
TBPS=`expr $T2 - $T1`
RBPS=`expr $R2 - $R1`
TKBPS=`expr $TBPS / `
RKBPS=`expr $RBPS / `
echo "TX $1: $TKBPS kb/s RX $1: $RKBPS kb/s"
done
netspeed.sh
Linux下统计高速网络中的流量的更多相关文章
- 如何在Linux下统计高速网络中的流量
参考: http://www.geekfan.net/5558/ http://blog.jobbole.com/23638/ http://www.csdn.net/article/2014-03- ...
- linux下脚本监控网络流量
linux下脚本监控网络流量 学习了:https://blog.csdn.net/chenghuikai/article/details/48437479 学习了:http://www.jb51.ne ...
- Linux下高并发网络编程
Linux下高并发网络编程 1.修改用户进程可打开文件数限制 在Linux平台上,无论编写客户端程序还是服务端程序,在进行高并发TCP连接处理时, 最高的并发数量都要受到系统对用户单一进程同时可打 ...
- Linux下统计出现次数最多的指定字段值
假设桌面上有一个叫“data.txt”的文本,内容如下: {id='xxx' info='xxx' kk='xxx' target='111111' dd='xxx'}{id='xxx' info=' ...
- 在Linux下安装PHP过程中,编译时出现错误的解决办法
在Linux下安装PHP过程中,编译时出现configure: error: libjpeg.(a|so) not found 错误的解决办法 configure: error: libjpeg.(a ...
- Linux 下 expect 脚本语言中交互处理常用命令
Linux 下 expect 脚本语言中交互处理常用命令 1. #!/usr/bin/expect 告诉操作系统脚本里的代码使用那一个 shell 来执行.这里的 expect 其实和 Linux 下 ...
- 查看Linux下*.a库文件中文件、函数、变量
查看Linux下*.a库文件中文件.函数.变量等情况在Linux 下经常需要链接一些 *.a的库文件,那怎么查看这些*.a 中包 含哪些文件.函数.变量: 1. 查看文件:ar -t xxx.a 2. ...
- 在Linux下,在网络没有配置好前,怎样查看网卡的MAC地址?
在Linux下,在网络没有配置好前,怎样查看网卡的MAC地址? 使用 dmesg 与 grep 命令来实际,例如以下: [root@localhost ~]# dmesg | grep eth e10 ...
- windows下数据库文件使用脚本同步到linux下的mysql数据库中
1.背景 windows server 2008 下 每天会有 *.sql数据文件 需要上传到linux 中的mysql数据库中 而运维人员是在 windows server 下使用 xshell 连 ...
随机推荐
- 二、JavaScript语言--事件处理--DOM事件探秘--下拉菜单
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Jmeter 中通过(_time函数)获取10位时间戳的方法
meter的__time函数作用是取当前时间的时间戳,默认取的时间精确到了毫秒级别,所以获取的时间戳默认是13位的. 下图为取10位的时间戳的函数表达式(时间精确到秒)
- ManageEngine Glossary
https://www.manageengine.com/products/applications_manager/help/glossary-applications-manager.html#s ...
- sdut 1592转置矩阵【稀疏矩阵的压缩存储】【快速转置算法】
转置矩阵 Time Limit: 1000ms Memory limit: 32768K 有疑问?点这里^_^ 题目链接:http://acm.sdut.edu.cn/sdutoj/proble ...
- 【Agorithm】一次一密加密解密算法
#include<iostream> #include<cstdio> #include<cstdlib> #include<ctime> #inclu ...
- Microshaoft WinDbg cmdtree
windbg ANSI Command Tree 1.0 title {"Microshaoft Commands"} body {"cmdtree"} {&q ...
- Java8中的default方法
default方法 Java 8中引入了一个新的概念,叫做default方法,也可以称为Defender方法,或者虚拟扩展方法(Virtual extension methods). Default方 ...
- oc中定时器的基本使用
// 时间间隔 调用的对象 调用的方法 用户信息 是否循环 [NSTimer scheduledTimerWithTimeInterval: target:self selector:@select ...
- C#实现序列化和反序列化
从我们面试准备上面,我知道了一个知识点,就是我们vs提供的序列化方法有两个,一个叫二进制序列化,一个叫做xml序列化,下面我们说一下二进制序列化的C#实现: 反序列化: public static T ...
- MySQL中的SQL语言
从功能上划分,SQL 语言可以分为DDL,DML和DCL三大类.1. DDL(Data Definition Language)数据定义语言,用于定义和管理 SQL 数据库中的所有对象的语言 :CRE ...