1 #*********************************************************************
2 # Running periodic system or process monitoring without using cron. *
3 #*********************************************************************
4 monitorpass()
5 {
6 percent=`lsps -s | awk '!/Total/{print $2}' | sed 's/%//'`
7
8 if [ "$percent" -ne "$last_percent" ]
9 then
10 stamp=`date "+%y%m%d %H%M%S"`
11 echo "${stamp} ${percent}"
12 last_percent="$percent"
13 fi
14
15 } # End of subroutine monitorpass
16 #---------------------------------------------------------------------
17 last_percent="00"
18 pass=1
19 while [ $pass -le 10000 ]
20 do
21 monitorpass $1 2>&1 | tee -a /tmp/lsps.anal.log
22 sleep 899 # 15 min
23 pass=`expr $pass + 1`
24 done #05
|