iftop和iostat安装和简单使用

1、安装

安装依赖包,yum install flex byacc  libpcap ncurses ncurses-devel libpcap-devel

上传到linux安装包,可以使用crt中的put命令上传,解压可能需要用到unzip、tar命令,其中解压gz2参数是jxvf,gz的是zxvf

安装,先编译,在解压的目录下执行:./configure 然后make && make install

2、使用

其中iftop

iftop: display bandwidth usage on an interface by host

Synopsis: iftop -h | [-npbBP] [-i interface] [-f filter code] [-N net/mask]

   -h                  display this message
   -n                  don't do hostname lookups
   -N                  don't convert port numbers to services
   -p                  run in promiscuous mode (show traffic between other
                       hosts on the same network segment)
   -b                  don't display a bar graph of traffic
   -B                  Display bandwidth in bytes
   -i interface        listen on named interface
   -f filter code      use filter code to select packets to count
                       (default: none, but only IP packets are counted)
   -F net/mask         show traffic flows in/out of network
   -P                  show ports as well as hosts
   -m limit            sets the upper limit for the bandwidth scale
   -c config file      specifies an alternative configuration file
sar的帮助

Usage: sar [ options... ] [ <interval> [ <count> ] ]
Options are:
[ -A ] [ -b ] [ -B ] [ -c ] [ -d ] [ -i <interval> ] [ -p ] [ -q ]
[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]
[ -I { <irq> | SUM | ALL | XALL } ] [ -P { <cpu> | ALL } ]
[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]
[ -x { <pid> | SELF | ALL } ] [ -X { <pid> | SELF | ALL } ]
[ -o [ <filename> ] | -f [ <filename> ] ]
[ -s [ <hh:mm:ss> ] ] [ -e [ <hh:mm:ss> ] ]

 

比如要查看一个文件读写5次间隔2秒,cpu使用情况

sar -u -o filename  2  5

 

查看内存sar -r 2 5

查看网络 sar -n DEV 2 5

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

朝闻道-夕死可矣

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值