linux工具类之流量监视
iptraf 好用 yum install iptraf
iptraf is an ncurses-based IP LAN monitor that generates various network statistics including TCP info, UDP counts, ICMP and OSPF information, Ethernet,load info, node stats, IP checksum errors, and others.If the command is issued without any command-line options, the program comes up in interactive mode, with the various facilities accessed through the main menu.
ipband
nethogs
安装nethogs
yum -y install nethogs
(1)、可以实时查看系统当前进程的流量
(2)、可以和nload结合起来,可以诊断出很多问题。
如果要将这些数据记录到日志里,可以使用下面的命令:
nethogs -b | tee log.txt
nload 不自带 简单直观
wget http://www.roland-riegel.de/nload/nload-0.7.2.tar.gz
tar zxvf nload-0.7.2.tar.gz
cd nload-0.7.2
./configure;make;make install
使用
直接用nload回车即可,也可以指定网卡,如nload eth1
还可以指定是以K或M来显示流量,如nload -u M显示的流量是以MB为单位的
看看还有哪些参数或选项
[root@wdlinux ~]# nload -u K
[root@wdlinux ~]# nload -h
ifstat 不自带 简单直观
Ifstat is a little tool to report interface activity, just like iostat/vmstat do for other system statistics.
ifstat gathers these statistics from the kernel internal counters, which is highly operating system dependent.Right now, the following systems are supported:
Linux >= 2.2.0 (through /proc/net/dev file).
FreeBSD >= 2.2 (using the ifmib(4) interface).
Solaris >= 5.6 (using the kstat(3K) interface).
IRIX and OpenBSD (using the SIOCGIFDATA ioctl).
NetBSD and Darwin (using the route(4) sysctl interface).
Other BSDs (using the kvm(3) interface).
Digital Unix (OSF/1), Tru64, and Aix (using the legacy kmem interface).
HP-UX (using the DPLI streams interface).
Win32 native or through Cygwin (using the GetIfTable call).
wget -S http://gael.roualland.free.fr/ifstat/ifstat-1.1.tar.gz
tar zxvf ifstat-1.1.tar.gz
cd ifstat-1.1
./configure
make;make install
ifstat
iftop 不自带
安装库文件,需要 libpcap 及 libcurses 。
yum install -y flex byacc libpcap ncurses ncurses-devel libpcap-devel
wget -S http://www.ex-parrot.com/~pdw/iftop/download/iftop-0.17.tar.gz
tar zxvf iftop-0.17.tar.gz
cd iftop-0.17
./configure make;make install
使用
iftop -i eth1 -B
iftop -i eth2 -B -m 30M
iftop -n -i eth1
iftop -i eth0 -n -P 显示端口号
http://jiajun.iteye.com/blog/419515
watch ifconfig
watch more /proc/net/dev
watch -n 1 "/sbin/ifconfig eth0 | grep bytes"
ulimit -n
[root@CactiEZ ~]# netstat -s
[root@CactiEZ ~]# sar -n DEV 1
[root@CactiEZ ~]# sar -n EDEV 1 2
-n参数很有用,他有6个不同的开关:DEV | EDEV | NFS | NFSD | SOCK | ALL 。
DEV显示网络接口信息,EDEV显示关于网络错误的统计数据,NFS统计活动的NFS客户端的信息,NFSD统计NFS服务器的信息,SOCK显示套接字信息,ALL显示所有5个开关。它们可以单独或者一起使用。
rxerr/s:每秒钟接收的坏数据包 txerr/s:每秒钟发送的坏数据包 coll/s:每秒冲突数
rxdrop/s:因为缓冲充满,每秒钟丢弃的已接收数据包数
txdrop/s:因为缓冲充满,每秒钟丢弃的已发送数据包数
txcarr/s:发送数据包时,每秒载波错误数
rxfram/s:每秒接收数据包的帧对齐错误数
rxfifo/s:接收的数据包每秒FIFO过速的错误数
txfifo/s:发送的数据包每秒FIFO过速的错误数
linux工具类之流量监视的更多相关文章
- linux工具类之硬盘检测
软raidmount /dev/md0 /opt [root@localhost root]# cp /usr/share/doc/raidtools-1.00.3/ra ...
- jsch连接Linux工具类
import com.alibaba.fastjson.JSONObject;import com.jcraft.jsch.*;import org.slf4j.Logger;import org.s ...
- 免费IP代理池定时维护,封装通用爬虫工具类每次随机更新IP代理池跟UserAgent池,并制作简易流量爬虫
前言 我们之前的爬虫都是模拟成浏览器后直接爬取,并没有动态设置IP代理以及UserAgent标识,本文记录免费IP代理池定时维护,封装通用爬虫工具类每次随机更新IP代理池跟UserAgent池,并制作 ...
- Java中windows路径转换成linux路径等工具类
项目中发现别人写好的操作系统相关的工具类: 我总结的类似相关博客:http://www.cnblogs.com/DreamDrive/p/4289860.html import java.net.In ...
- 24小时学通Linux内核--内核探索工具类
寒假闲下来了,可以尽情的做自己喜欢的事情,专心待在实验室里燥起来了,因为大二的时候接触过Linux,只是关于内核方面确实是不好懂,所以十天的时间里还是希望能够补充一下Linux内核相关知识,接下来继续 ...
- 十天学Linux内核之第一天---内核探索工具类
原文:十天学Linux内核之第一天---内核探索工具类 寒假闲下来了,可以尽情的做自己喜欢的事情,专心待在实验室里燥起来了,因为大二的时候接触过Linux,只是关于内核方面确实是不好懂,所以十天的时间 ...
- Java,面试题,简历,Linux,大数据,常用开发工具类,API文档,电子书,各种思维导图资源,百度网盘资源,BBS论坛系统 ERP管理系统 OA办公自动化管理系统 车辆管理系统 各种后台管理系统
Java,面试题,简历,Linux,大数据,常用开发工具类,API文档,电子书,各种思维导图资源,百度网盘资源BBS论坛系统 ERP管理系统 OA办公自动化管理系统 车辆管理系统 家庭理财系统 各种后 ...
- 《Unix/Linux日志分析与流量监控》书稿完成
<Unix/Linux日志分析与流量监控>书稿完成 近日,历时3年创作的75万字书稿已完成,本书紧紧围绕网络安全的主题,对各种Unix/Linux系统及网络服务日志进行了全面系统的讲解,从 ...
- 发布《Linux工具快速教程》
发布<Linux工具快速教程> 阶段性的完成了这本书开源书籍,发布出来给有需要的朋友,同时也欢迎更多的朋友加入进来,完善这本书: 本书Github地址:https://github.com ...
随机推荐
- What is hmux in resin?
When I start the Resin server it says hmux listening to localhost:6802 What is this hmux? Is this a ...
- 学习笔记:iPhone终极指南、手机端、浏览器各种规范
手机图解参考:http://www.paintcodeapp.com/news/iphone-6-screens-demystified 手机图标尺寸参考:https://developer.appl ...
- Java 集合深入理解(12):古老的 Vector
点击查看 Java 集合框架深入理解 系列, - ( ゜- ゜)つロ 乾杯~ 今天刮台风,躲屋里看看 Vector ! 都说 Vector 是线程安全的 ArrayList,今天来根据源码看看是不是这 ...
- 农场阳光 (simpson)
计算若干个圆与一个矩形的面积并 simpson公式 ans = ( f[l] + f[r] + 4 * f[mid] ) * (r-l) / 6 uses math; type arr=record ...
- "Your local changes to the following files would be overwritten by merge" on git
运行: git merge --ff origin/master 得到错误信息: error: Your local changes to the following files would be o ...
- 关于VS中更改栈和堆空间的大小
编号:1008时间:2016年4月12日17:01:38功能:关于VS中更改栈和堆空间的大小 URL:http://blog.csdn.net/icerock2000/article/details/ ...
- error: failed to initialize alpm library
这个问题出在archlinux上面 [root@sarch pacman]# pacman -Syuerror: failed to initialize alpm library(database ...
- ZOJ 1067 Color Me Less
原题链接 题目大意:一道类似于简单图像压缩的题目.给定一个调色板,然后把24位真彩色按照就近原则聚类. 解法:每个像素的色彩都是RGB三个值,相当于三维空间的一个点.所以当一个新的像素进来时,分别和调 ...
- 《C标准库》——之<ctype.h>
在没读<ctype.h>的源码之前,我一直以为我们平时用的isalnum.isdigit.isalpha等这些函数,是靠判断写出来的. 比如: int isdigit(int c){ re ...
- 使用move_base导航 ---13
摘要: 原创博客:转载请表明出处:http://www.cnblogs.com/zxouxuewei/ 我们现在准备用move_base简单的移动机器人记住,一个“pose”在ros的意思是一个位置和 ...