create the swap partition - can be datadg or rootdg
# vxassist -g datadgorrootdg make swap_v 500m layout=mirror A1L1 A1R1
or mkfile 300m /export/home/swap
add the swap partition
# /usr/sbin/swap -a /dev/vx/dsk/datadg/swap_v
create the entry in the /etc/vfstab but do not mount
/dev/vx/dsk/datadg/swap_v /dev/vx/rdsk/datadg/swap_v - swap - no -
Permanently create the swap partition
# vi /etc/rc2.d/S99addswap
#!/bin/ksh
#
# Add extra partition to swap
#
/usr/sbin/swap -a /dev/vx/dsk/datadg/swap_v
# chmod u+x /etc/rc2.d/S99addswap
-------------------------------------------------------
SWAPFILE - 2Gb created swapfile in /tmp
# cat S100swap
#!/sbin/sh
#
# Temporary measure to add swapspace 17/11/05 jc 64148
#
/usr/sbin/mkfile 2048m /tmp/swapleave
/usr/sbin/swap -a /tmp/swapleave
exit 0
Swap monitoring Script
FREE=`/usr/sbin/swap -s |awk '{print $11}'|cut -f1 -d 'k' `
USED=`/usr/sbin/swap -s |awk '{print $9}'|cut -f1 -d 'k' `
TOTAL=`expr $FREE + $USED`
LEFT=`expr $TOTAL - $USED`
RATIO=`expr $USED \* 100 / $TOTAL`
echo `date` > /tmp/swap.log
echo "Space left : $LEFT " >>/tmp/swap.log
echo "Total space : $TOTAL " >>/tmp/swap.log
echo "" >> /tmp/swap.log
echo "$RATIO% of the available swap space is utilized" >> /tmp/swap.log
echo "" >> /tmp/swap.log
ps -e -o user,pid,ppid,vsz,rss,time,comm | sort -k 4rn | head -15 >> /tmp/swap.log
echo "" >> /tmp/swap.log
/opt/freeware/bin/top >> /tmp/swap.log
#change the threshold here:
if [ $RATIO -ge 40 ]
then mailx -s "Swap issue on `hostname`" aaa@mail.ru < /tmp/swap.log
fi
rm /tmp/swap.log
Подписаться на:
Комментарии к сообщению (Atom)
Комментариев нет:
Отправить комментарий