#!/bin/ksh DATE_LAST=`echo "$(date +%d) - 1" | bc` HOSTNAME=`hostname` DEG=0 swpin=`sar -w -f /var/adm/sa/sa$DATE_LAST|grep "Average"|awk '{print $2}'` swpout=`sar -w -f /var/adm/sa/sa$DATE_LAST|grep "Average"|awk '{print $4}'` cpuidle=`sar -u -f /var/adm/sa/sa$DATE_LAST|grep "Average"|awk '{print $5}'` if [[ $swpin -gt 0 ]] then DEG_VAL=`echo "swpin = $swpin"` DEG=$(( $DEG + 1 )) fi if [[ $swout -gt 0 ]] then DEG=$(( $DEG + 1 )) DEG_VAL=`echo $DEG_VAL| "swpin = $swpin"` fi if [[ $cpuidle -lt 50 ]] then DEG=$(( $DEG + 1 )) DEG_VAL=`echo $DEG_VAL| "cpuidle = $cpuidle"` fi if [[ $DEG -gt 0 ]] then echo $DEG_VAL else echo "0" fi