script for memory monitoring and sending mail to users in network | Unix Linux Forums | Ubuntu

  Go Back    


Ubuntu Ubuntu is a complete desktop Linux operating system, freely available with both community and professional support.

script for memory monitoring and sending mail to users in network

Ubuntu


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-15-2010
navdeep5673 navdeep5673 is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 23 July 2010, 4:13 AM EDT
Location: dehradun
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
script for memory monitoring and sending mail to users in network

I m working on a script which monitors the disk usage and send a mail to the users if it reaches a limit of 90%.
hlp me
Sponsored Links
    #2  
Old 07-15-2010
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
code tag tagger
 
Join Date: Sep 2007
Last Activity: 21 November 2014, 12:59 AM EST
Location: St. Gallen, Switzerland
Posts: 6,244
Thanks: 124
Thanked 453 Times in 412 Posts
Where did you get stuck - show the problem.
Sponsored Links
    #3  
Old 07-15-2010
navdeep5673 navdeep5673 is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 23 July 2010, 4:13 AM EDT
Location: dehradun
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
hi


Code:
df -k | awk 'int($5) > 95{ 
  subject = $1 " More than 95% disk usage "
  email = "navdeep5673@hotmail.com"
  cmd = "mailx -s \"" subject "\" " email
  cmd  | getline #or system(cmd)
  }
'

Now what to do?

Please help me. I'm not professional.

Last edited by Scott; 07-15-2010 at 06:22 AM.. Reason: Please use code tags, and no "cyberchat" writing, thanks
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
shell script for monitoring users activities rrd1986 Shell Programming and Scripting 3 08-27-2010 10:31 AM
Solaris CPU/memory status monitoring (Shell script or c++) shingpui Programming 6 05-12-2009 09:57 AM
sending a mail using shell script anitha126 Shell Programming and Scripting 1 11-27-2008 07:31 AM
sending mail from a script Amardeep HP-UX 6 01-08-2007 02:32 AM
Sending Mail Thru Unix Script Omkumar Shell Programming and Scripting 5 03-31-2005 12:29 AM



All times are GMT -4. The time now is 02:42 AM.