Last active
April 19, 2024 10:35
-
-
Save rindeal/65cd940f7a33c9c8e49018adb673fe0e to your computer and use it in GitHub Desktop.
Linux file IO monitoring sysdig read/write/open files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# per process stats | |
awk -F\| '{a[$1]++}END{for(p in a)printf "%-20s | %d\n",p,a[p]}' io.log | sort -t\| -nk2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo sysdig -p '%proc.name|%evt.arg.fd.name' \ | |
'evt.dir=> and ( fd.type=file or fd.type=directory ) and fd.name!=""' | \ | |
awk -F\| ' | |
BEGIN{ | |
OFS="|" | |
} | |
$2!~/^<f>\/(dev|proc|run|sys).*/ { | |
print $1,substr($2,4); | |
} | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment