690 shaares
3 liens privés
3 liens privés
4 résultats
taggé
vmstat
Grapher les sorties vmstat
Résumé des commandes :
uptime
dmesg | tail
vmstat 1
mpstat -P ALL 1
pidstat 1
iostat -xz 1
free -m
sar -n DEV 1
sar -n TCP,ETCP 1
top
Pour nettoyer la sortir :
cat $1 | grep -v memory | grep -v buff | perl -p -e "s| | |g" -| perl -p -e "s| | |g" - | perl -p -e "s| | |g" - | awk 'BEGIN {x=1}; {print x++ " " $1 " " $2 " " $3 " " $4 " " $5 " " $6 " " $7 " " $8 " " $9 " " $10 " " $11 " " $12 " " $13 " " $14 " " $15 " " $16;}'
A short script to record top & vmstat, create monitor.sh
#!/bin/bash
echo "To kill : cat *.pid | xargs kill"
cp top.output top.output.old 2>&1 > /dev/null ; rm -f top.output
cp vmstat.output vmstat.output.old 2>&1 > /dev/null ; rm -f vmstat.output
(vmstat 30 & echo $! > vmstat.pid) | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush() }' 2>&1 > vmstat.output &
echo $$ > monitor.pid
while :
do
top -b -n 1 | grep -v "0.0 0.0" 2>&1 | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush() }' 2>&1 >> top.output
sleep 30
done
Then monitor.sh &
Will add soon a link to an excel file to analyze the results.
Of course zimbra like tools are much more friendly but sometimes, you have a console and few access...