Need a script to see top processes for every hour

Hi All,

I am new to Scripting , please give me guidance to write the script to see top processes on the Linux operating system.

I executed this script on my Virtual Server(Linux)

DATE=`date +%Y%m%d%H%M%S`
HOME=/home/xmp/testing/xmp_report
RADIUS_PID=`xms -xmp sh pr | grep "RADIUS.iamsp02ldv" |awk '{ print $3 }'`
PSE_PID=`xms -xmp sh pr | grep "PRESENCE-STORE.iamsp02ldv" |awk '{ print $4 }'`


printf "\n\n############## Process Info. #############\n\n" >> $HOME.$DATE
top -b -p $RADIUS_PID -n 1 >> $HOME.$DATE

printf "\n\n############## CPU Info. PSE  #############\n\n" >> $HOME.$DATE
top -b -p $PSE_PID -n 1 >> $HOME.$DATE

exit 0

i am getting out put like below

test: line 5: xms: command not found
test: line 6: xms: command not found
	top: bad pid '-n'

	top: bad pid '-n'

please any one help me on this

Thanks in advance
Venkat

Is xms' path on the PATH variable? Can you run it manually fron the command line?

AND - it's used in line 3 and 4 in your script, not line 5 or 6. So - how do the error messages fit your script?

Determine if your "xms" command is in your path:

which xms

Also determine the exact directory you need in your path for which version of the 'xms' you want to run:

find / -name "xms" 2>/dev/null