script for check swab usage linux

1. check by pattern

for file in /proc/*/status ; do awk '/VmSwap|Name|Pid/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | grep zabbix| awk '{SUM+=$5}'END'{print SUM}'

2. check all usage swab

for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | less

Posting Komentar

Lebih baru Lebih lama