sysdig 超级系统工具

Sysdig 是一个超级系统工具,比 strace、tcpdump、lsof 加起来还强大。可用来捕获系统状态信息,保存数据并进行过滤和分析。使用 Lua 开发,提供命令行接口以及强大的交互界面。

使用示例

网络

查看占用网络带宽最多的进程

sysdig-probe-loader  (不执行,下面会报错)

sysdig -c topprocs_net
Bytes               Process             PID                 
--------------------------------------------------------------------------------
18.03KB             prometheus          1408
388B                sshd                1495

显示主机192.168.0.1的网络传输数据

as binary:
sysdig -s2000 -X -c echo_fds fd.cip=192.168.0.1
as ASCII:
sysdig -s2000 -A -c echo_fds fd.cip=192.168.0.1

查看连接最多的服务器端口

in terms of established connections:
sysdig -c fdcount_by fd.sport "evt.type=accept"
in terms of total bytes: sysdig -c fdbytes_by fd.sport

查看客户端连接最多的ip

in terms of established connections
sysdig -c fdcount_by fd.cip "evt.type=accept"
in terms of total bytes
sysdig -c fdbytes_by fd.cip

列出所有不是访问apache服务的访问连接

sysdig -p"%proc.name %fd.name" "evt.type=accept and proc.name!=httpd"

应用

查看机器所有的HTTP请求

sudo sysdig -s 2000 -A -c echo_fds fd.port=80 and evt.buffer contains GET

查看机器所有的SQL select查询

sudo sysdig -s 2000 -A -c echo_fds evt.buffer contains SELECT

硬盘 I/O

查看使用硬盘带宽最多的进程

sysdig -c topprocs_file

列出使用大量文件描述符的进程

sysdig -c fdcount_by proc.name "fd.type=file"

更多用法参看:

https://www.oschina.net/p/sysdig?hmsr=aladdin1e1

https://www.cnblogs.com/NiceTime/p/7640558.html   安装

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

少安在线锤人

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

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

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

打赏作者

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

抵扣说明:

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

余额充值