Alert When a Process Exceeds a CPU Utilization Limit...

Hi EveryOne

We run CICS Sofware on our AIX Machine...

When ever some Process or Transaction loops it Takes heavy process Usage..

Is there a way that i can Get a alert message or a Message Thrown on to screen when ever a process named "cicsas" uses more that 20%... fo CPU..

I was tracking the CPU% form topas command and kill the porcess if it has more that 20% CPU and time is more than 15mins...

Can we automate this or atleast get altered that some thing is wrong....

This tool should work for you. HTH

Its a client machine and they are not permiting to install any new software...

Can we do this with some shell scripts... ??

I just need a alert need not limit the process from using the CPU... based on the alert we need to take necessarty action...

I thought of some thing this sort

1) Moniotr topas -P
2) Get top 10 process
3) Check if it has "cicsas"
4) Check the % utilizion and of it exceeds 20% through a message on to console..

But topas -P is getting refreshed after given interval -i(interval time)

Is there a way that i can get a snapshot of the processor utilization at paticular time....

I have done some thing of this sort...

cpu=`ps aux|grep cicsas|head -1|tr -s " " "" |cut -f 3 -d " "`

limit=20.0

c=$(echo $limit - $cpu | bc)

if [[ $c = -* ]] ; then
mail -s "Process is Taking more Memory.." USER_NAME < tmp
fi

This sends me a mail... but.

Only when i check the mail i can see the messages...

Is is possible to get alert message when ever a new mail comes??

This generally happens when ever a user logins... we get a message on screen saying "[YOU HAVE NEW MAIL]"

Can this happen when ever a new mail comes in.....