The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Memory and CPU utilization process learnbash Shell Programming and Scripting 4 05-21-2008 03:21 PM
cpu utilization of a process iam AIX 2 02-20-2008 01:50 AM
Counting Files and send an email Notification if it exceeds a limit amitsayshii UNIX for Dummies Questions & Answers 10 07-07-2006 11:25 AM
script to check for a particular process and alert if its not running goks Shell Programming and Scripting 1 12-09-2005 05:11 AM
ALERT!!! ALERT!!! I messed up the UNIX!!! Fwurm UNIX for Dummies Questions & Answers 15 11-06-2001 05:53 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-18-2007
pbsrinivas pbsrinivas is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 141
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....
  #2 (permalink)  
Old 06-18-2007
sysgate's Avatar
sysgate sysgate is offline Forum Advisor  
Unix based
  
 

Join Date: Nov 2006
Location: Bulgaria
Posts: 1,323
This tool should work for you. HTH
  #3 (permalink)  
Old 06-18-2007
pbsrinivas pbsrinivas is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 141
Quote:
Originally Posted by sysgate View Post
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...
  #4 (permalink)  
Old 06-19-2007
pbsrinivas pbsrinivas is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 141
Quote:
Originally Posted by sysgate View Post
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....
  #5 (permalink)  
Old 06-20-2007
pbsrinivas pbsrinivas is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 141
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.....
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:18 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0