nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Disk space alert via email

This is a discussion on Disk space alert via email within the Shell scripting forums, part of the Development/Scripting category; Hi All, I am looking for some script which will mail to me when disk space is above set limit. ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 06-10-2008, 10:33 AM
Junior Member
User
 
Join Date: May 2008
My distro: RedHat/Solaris
Posts: 6
Rep Power: 0
aasif.shaikh is on a distinguished road
Post Disk space alert via email

Hi All,

I am looking for some script which will mail to me when disk space is above set limit. I am using Linux. Thnx in advance.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-10-2008, 03:58 PM
Junior Member
User
 
Join Date: Feb 2008
My distro: .
Posts: 9
Rep Power: 0
unSpawn is on a distinguished road
Default

If you want to script this yourself you save the threshold to a variable, run 'df -m' and pipe it through awk with the devicename as searchterm, print the (space separated) fifth field and save that as a variable. Then remove the percentage sign from the variable ("VAR=${VAR//\%}"), then make the variable have a default value to take unmounted partitions into account ("${VAR:=0}"), then compare ("-ge") with your threshold value and "&& mail args".
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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

Similar Threads

Thread Thread Starter Forum Replies Last Post
Creating the perl Backup script for hard disk to hard disk backup vmr.gouda CentOS / RHEL / Fedora 2 05-15-2008 01:08 AM
Shell script to check the disk space on remote systems vijayscripts Shell scripting 5 10-21-2007 06:29 PM
mod_rewrite with convertion of space and / to _ kasimani Networking, Firewalls and Security 0 03-13-2007 11:52 AM
mod_rewrite with convertion of space and / to _ kasimani Web servers 0 03-13-2007 11:51 AM
Replaceing [] and white space with sed TiredOrangeCat Shell scripting 2 02-12-2007 10:58 PM


All times are GMT +5.5. The time now is 06:59 AM.


Powered by vBulletin® Version 3.7.2 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36