![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 01:45 PM |
| Disk Space - | Docboyeee | Filesystems, Disks and Memory | 2 | 08-22-2002 12:46 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 |
![]() |
| Bookmarks |
| Tags |
| mailx, monitoring |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|