690 shaares
3 liens privés
3 liens privés
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...