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

Tags used in this thread
Popular LQ Tags , ,

Reply
 
Thread Tools
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: 610
Thanked: 5

[Log in to get rid of this advertisement]
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
ncsuapex is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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


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 11:41 PM.

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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration