LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 06-24-2010, 01:57 AM   #1
dlugasx
Member
 
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 266

Rep: Reputation: 19
hard disk space email notification - SOLARIS 10 - script


Hi Gurus,

I`m looking for an email notification script for Solaris 10.
Using that script I would like to control disk space on my server. If for example more than 90% hard disk space will be used, server should sent email to me.

Does anybody have such a script ? I`m using ZFS filesystem.

cheers

Dlugasx
 
Old 06-24-2010, 06:49 AM   #2
yooy
Senior Member
 
Registered: Dec 2009
Posts: 1,387

Rep: Reputation: 174Reputation: 174
Quote:
DISKSPACE=`df | grep "/dev/sda1" | awk '{ print $4 }'`

if [ "$DISKSPACE" -lt "600240" ] ; then
beep -f 1000 -n -f 2000 -n -f 1500
/usr/bin/notify-send -u normal -t 100000 \
'Check low disk' '/dev/sda1 is less than 06 GB.'
/usr/bin/notify-send -u normal -t 100000 \
'deleting trash in 100 s' 'deleting trash in 100 s'
sleep 100
rm -r ~/.local/share/Trash/files/*
fi
this is running inside my while true loop
 
1 members found this post helpful.
  


Reply



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
A script for looking at hard disk space wimnat Linux - Hardware 2 09-24-2009 09:09 PM
Getting Notification when disk space cross a threshold value raikar Linux - Mobile 4 06-30-2009 05:54 AM
I need help writing script to monitor the hard disk space xmdms Linux - Newbie 23 09-05-2008 02:14 PM
LXer: Perl script to monitor disk space and send an email alert LXer Syndicated Linux News 1 02-23-2007 01:12 PM
E-mail notification of low disk space Hypocrite Linux - General 2 11-10-2004 02:27 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 11:34 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration