The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
cpu, memory and virtual memory usage ocelot UNIX for Dummies Questions & Answers 4 12-01-2008 07:57 AM
How can I get memory usage or anything that show memory used from sar file? panithat HP-UX 1 03-31-2008 12:26 PM
RAM Physical Memory usage by each Process. bsrajirs SUN Solaris 12 11-19-2007 09:18 AM
how to restrict memory usage by a process frankkahle UNIX for Advanced & Expert Users 4 10-25-2007 08:26 PM
Monitor CPU usage and Memory Usage Gajanad Bihani High Level Programming 2 03-09-2005 07:35 AM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-02-2008
tafil tafil is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 14
Memory usage of a process

hi all,

i want to write a script that checks the memory usage of processes and send a mail with the name of the process witch is using more then 300mb RAM.
dose anybody have a sample script or an idea how i can make it ?

PROCCESSES="snmpd sendmail"


for myVar in $PROCCESSES
do
var1=$(ps -eo fname,rss | grep $myVar |awk '{print $2}'| awk '$1 > 200000')
echo $var1
if [ -n $var1 ]; then
echo "test1 mail later on"
else
echo "test2 mail later on"
fi
done

thanks in advance
 

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 06:05 PM.


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