![]() |
|
|
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 |
| Summary of metadevices (soft partitions,mirror) + filesystems + space | iBot | Solaris BigAdmin RSS | 0 | 02-04-2009 02:30 PM |
| Shell script to monitor tmp folder for uploads | mrfr0g | Shell Programming and Scripting | 6 | 08-19-2008 12:37 PM |
| Monitor Disk Space | sam786 | Shell Programming and Scripting | 3 | 02-08-2008 06:56 PM |
| Automatic monitor disk-space | anuradha | Filesystems, Disks and Memory | 3 | 01-15-2008 03:37 PM |
| paging space & monitor | Erik Rooijmans | UNIX for Dummies Questions & Answers | 2 | 05-13-2003 01:45 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Shell script partitions space monitor
Hello friends, I'm newbie in shell scripting... Until now i have this script: Code:
#!/bin/sh emailok = email1@domain.com emailissue = email2@domain.com limit="50" df -h | grep -vE '^Filesystem' | awk '{print $1 " " $4 " " $5}'|while read val do partition=$(echo $val | awk '{print $1}') echo "partition:$partition" usedspace=$(echo $val | awk '{print $3}'| cut -d'%' -f1) echo "usedspace:$usedspace%" availspace=$(echo $val | awk '{print $2}') echo "space available:$availspace" echo "limit:$limit" if [ $usedspace -gt $limit ]; then echo "less than 50% space in $partition = $availspace"|mail -s "space info" $emailissue else echo "All ok." |mail -s "space info" $emailok fi done the problem is that i have 2 partitions, and i receive 2 mails. If i have more than 2, then i will receive more mails. what i want is to receive 1 mail, with 2 or more messages. any ideas? Last edited by john_doe; 05-06-2009 at 10:53 AM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|