Différences
Ci-dessous, les différences entre deux révisions de la page.
informatique:nix:linux:linux_mem [2012/06/19 14:12] – modification externe 127.0.0.1 | informatique:nix:linux:linux_mem [2019/02/22 09:43] (Version actuelle) – ben | ||
---|---|---|---|
Ligne 45: | Ligne 45: | ||
sar -x $i 1 |egrep -v " | sar -x $i 1 |egrep -v " | ||
done | done | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | #!/bin/bash | ||
+ | # Get current swap usage for all running processes | ||
+ | # Usage: ./ | ||
+ | # Erik Ljungstrom 27/05/2011 | ||
+ | SUM=0 | ||
+ | OVERALL=0 | ||
+ | for DIR in `find /proc/ -maxdepth 1 -type d | egrep " | ||
+ | PID=`echo $DIR | cut -d / -f 3` | ||
+ | PROGNAME=`ps -p $PID -o comm --no-headers` | ||
+ | PROGPATH=`cat / | ||
+ | for SWAP in `grep Swap $DIR/smaps 2> /dev/null| awk '{ print $2 }'` | ||
+ | do | ||
+ | let SUM=$SUM+$SWAP | ||
+ | done | ||
+ | echo " | ||
+ | let OVERALL=$OVERALL+$SUM | ||
+ | SUM=0 | ||
+ | |||
+ | done | ||
+ | echo " | ||
</ | </ | ||