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 连 ...
随机推荐
- spring整合httpclient
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://w ...
- Linux进程的前后台切换
一.Linux前后台切换的相关命令: 1.& 在命令的后面加上这个符合,让命令进程在后台运行 例如: #ping 127.0.0.1 & // 此时命令ping ...
- JavaScript基础——使用JavaScript对象
JavaScript有许多内置对象,如Number(数字).Array(数组).String(字符串).Date(日期)和Math(数学).这些内置对象都有成员属性和方法.除了JavaScript对象 ...
- php PDO:数据访问抽象层
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Android touch事件的派发流程
Android TouchEvent事件传递机制 通俗易懂,能够了解Touch事件派发的基本流程. Android中的dispatchTouchEvent().onInterceptTouchEven ...
- Android Tab -- 使用ViewPager、PagerTitleStrip/PagerTabStrip来实现
原文地址:http://blog.csdn.net/crazy1235/article/details/42678877 效果:滑动切换:点击标签切换. 代码:https://github.com/l ...
- 23.备忘录模式(Memento Pattern)
using System; using System.Collections.Generic; namespace ConsoleApplication6 { /// <summary> ...
- PHP连接打印机
<?php header("Content-type: text/html; charset=utf-8"); class Netprint{ public $host = ...
- x264 - 高品质 H.264 编码器
转自:http://www.5i01.cn/topicdetail.php?f=510&t=3735840&r=18&last=48592660 H.264 / MPEG-4 ...
- shell判断文件是否存在
转自:http://www.cnblogs.com/sunyubo/archive/2011/10/17/2282047.html 1. shell判断文件,目录是否存在或者具有权限 2. #!/bi ...