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
Automatic monitor disk-space anuradha Filesystems, Disks and Memory 3 01-15-2008 03:37 PM
Automatic monitor disk-space nfbeerse Shell Programming and Scripting 3 03-01-2004 04:16 AM
available disk space on disk device??? alan UNIX for Dummies Questions & Answers 4 01-02-2004 03:06 AM
paging space & monitor Erik Rooijmans UNIX for Dummies Questions & Answers 2 05-13-2003 12:45 PM
Disk Space - Docboyeee Filesystems, Disks and Memory 2 08-22-2002 11:46 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-28-2008
sam786 sam786 is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 20
Monitor Disk Space

I would like to monitor disk space on solaris system.Need script which will send email if the disk space exceeds 90%.


Thanks
-sam
  #2 (permalink)  
Old 01-28-2008
Yogesh Sawant's Avatar
Yogesh Sawant Yogesh Sawant is offline Forum Staff  
Part Time Moderator and Full Time Dad
  
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 1,086
this will be helpful for you:
Code:
df -kh | grep '9.%'
use mailx command to send e-mail
  #3 (permalink)  
Old 01-31-2008
jagnikam jagnikam is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 56
Arrow require help for Shell Script

Quote:
Originally Posted by Yogesh Sawant View Post
this will be helpful for you:
Code:
df -kh | grep '9.%'
use mailx command to send e-mail
HI Yogesh I m using NFS so that create some problem
  #4 (permalink)  
Old 02-08-2008
vivsiv vivsiv is offline
Registered User
  
 

Join Date: Jun 2006
Location: Los Angeles
Posts: 17
here's a script

#!/bin/ksh
TEMPDIR=$HOME
FILE=mail.log
sendemail=-1
HOSTNAME="vivek" ###ur unix server name
space=`df -bhk /users/directory |awk '{print$5}'` ## dir were u want to monitor
echo "$space is the file size percent"
#capacity=${space%?}
#capacity=$space|/usr/xpg4/bin/awk -F"[%]" '{ print $1}'
capacity=`df -bhk /users/directory| grep directory |awk '{print $5}'|sed 's/\%//'`

echo "capacity in $HOSTNAME is $capacity " >> $TEMPDIR/$FILE
if [ $capacity -gt 90 ]; then
echo "alert space in $HOSTNAME getting full "
echo > $TEMPDIR/$FILE
echo "*************************************************" >> $TEMPDIR/$FILE
echo "Problem with siebel disk space on $HOSTNAME" >> $TEMPDIR/$FILE
/usr/bin/mailx -s "ALERT: Problem with file space on $HOSTNAME " "vivek@unix.com" < $TEMPDIR/$FILE
else
echo "enough space available"
fi
Sponsored Links
Closed Thread

Bookmarks

Tags
mailx, monitoring

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 07:01 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