Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-31-2008, 04:39 AM   #1
Registered: Oct 2007
Posts: 162

Rep: Reputation: 30
monitor OS

Dear all,

am monitoring the disk size, how can I write a script that if a particular disk size
reaches a threshold value , it should mail a warning to me.. How can I get this done..
am using the following code to monitor :

[root@oracle monitor]# vi

set -xv


echo "Oracle Production Server system log at $(date)" > "$LOGFILE"
# log vmstat. 3 * 5 second interval. Probably better than 1 second as it
# gives more time to average out the load analysis.

df -h >> $LOGFILE

echo "" >> "$LOGFILE"

cat $LOGFILE | mail -s "System status as of $(date +%d-%b-%Y)"

how can I add a threshold value.. such that if a particular mount point reaches 75% . it should send the warninig to me. meanwhile, if you can also advise me any enhancements in the above script

any inputs ?

Old 01-31-2008, 06:22 AM   #2
Registered: Jun 2007
Location: London, Athens
Distribution: Debian, Ubuntu
Posts: 36

Rep: Reputation: 15
Hello Yusuf,

I would use awk to grab the percentage from the output of df -h and then check if it is greater than 75 (or any other threshold you want) and if so send the warning email.

The awk will be something like

df -h | awk '{print $5}'

On the other hand there are open source tools that you can use to monitor pretty much everything. If you have many things to look after maybe it is worth having a look at the monit project.

I hope this helps.


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
default monitor on nvidia / dual monitor setup fenderog SUSE / openSUSE 3 05-01-2009 06:36 PM
How to automatically disable dual monitor setup when only one monitor is present NielsKM Linux - Laptop and Netbook 1 01-01-2008 12:17 PM
Issue trying to dual monitor with Dell 2005FPW LCD monitor damg Linux - Hardware 2 12-05-2005 11:13 AM
New monitor problems, Fedora Cora 3, Samsung 913N monitor gingermeatboy Linux - Hardware 2 08-23-2005 09:22 AM
Booting to wrong Monitor (w/ dual monitor setup) NeoNostalgia Linux - General 1 06-30-2004 02:49 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:06 AM.

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