Sysdig
中的chisel
是用Lua
语言编写的脚本,用来分析和处理sysdig
产生的event
。 Sysidg
会在下列目录中查找chisel
:., ./chisels, ~/chisels和/usr/share/sysdig/chisels
。
列出sysdig
所有的chisel
:
# sysdig -cl
Category: Application
---------------------
httplog HTTP requests log
httptop Top HTTP requests
memcachelog memcached requests log
Category: CPU Usage
-------------------
spectrogram Visualize OS latency in real time.
......
如果想查看关于某个chisel
的详细信息,可以使用-i
选项:
# sysdig -itopfiles_bytes
Category: I/O
-------------
topfiles_bytes Top files by R+W bytes
Shows the top files in terms of disk usage. This chisel is compatable with cont
ainers using the sysdig -pc or -pcontainer argument, otherwise no container inf
ormation will be shown.
Args:
(None)
执行chisel
使用-c
选项:
# sysdig -c topfiles_bytes
Bytes Filename
--------------------------------------------------------------------------------
Bytes Filename
--------------------------------------------------------------------------------
144B /dev/ptmx
Bytes Filename
--------------------------------------------------------------------------------
165B /dev/ptmx
也可以为chisel
指定参数:
# sysdig -c topfiles_bytes "not fd.name contains /dev"
Bytes Filename
--------------------------------------------------------------------------------
Bytes Filename
--------------------------------------------------------------------------------
Bytes Filename
--------------------------------------------------------------------------------
7.47KB /proc/cpuinfo
1024B /proc/meminfo
参考资料: