LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices

Reply
 
LinkBack Search this Thread
Old 05-29-2009, 09:31 AM   #16
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 42

Quote:
ALERT=90
df -H /dev/sda3 | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
do
echo $output
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge $ALERT ]; then
echo "Running out of space \"$partition ($usep%) used\" on $(hostname) as on $(date)" |
mail -s "Alert: Almost out of disk space $(hostname)" user@domain.com
fi
done


This is the script I use to email me when a filesystem goes above 90% used. I set it as a cron job for every 30 minutes. Although I have since replaced most of my server monitoring with nagios and it has a disk usage check
 
  


Reply

Tags
alert, mount, point


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
puppy+grub saves ram installed mount point as HD install mount point agualust Linux - Newbie 0 04-11-2009 08:44 PM
Increase space for mount point . . . eng_mohammedmostafa Linux - Software 7 03-26-2009 01:12 AM
Need more space to a mount point salmjuh Linux - Software 0 10-18-2004 06:03 AM
I need to reallocate drive space from mount point / to /boot decampbell1 Linux - Newbie 7 01-08-2004 03:34 PM


All times are GMT -5. The time now is 09:33 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration