# Free Space Monitoring Script



## naezdnik (Oct 5, 2009)

Hello! 

 Can you help me with a script which will monitoring my free space on hard drives? For example, if my free space less then 2000MB, it will senm me an email with warning.


----------



## vivek (Oct 5, 2009)

May be this will help:

http://bash.cyberciti.biz/monitoring/shell-script-monitor-unix-linux-diskspace/


----------



## naezdnik (Oct 5, 2009)

vivek said:
			
		

> May be this will help:
> 
> http://bash.cyberciti.biz/monitoring/shell-script-monitor-unix-linux-diskspace/



 Thanks, seems very useful. But i am nooby in BSD system, what shall i do apply this script?


----------



## dennylin93 (Oct 5, 2009)

Modify it as necessary. Then add a job in /etc/crontab.

You might be interested in sysutils/munin-main as well. It can graph disk usage as well other stuff.


----------



## DutchDaemon (Oct 5, 2009)

Leave /etc/crontab alone. Use the crontab of the user running the script ([cmd=]crontab -u $user[/cmd])


----------



## naezdnik (Oct 5, 2009)

Thanks, all. Problem has been solved with sysutils/monit utility. This utility can keep track space usage, cpu load, daemons state and also start, stop, restart services. It has web interface.


----------



## bigearsbilly (Oct 7, 2009)

as a quick aside

you may like to look at this...
x11-fm/xdiskusage/

you use it like so:

*xdiskusage dir*

and it gives you a really old-fashioned but nifty graphical
*du(1)* style summary of directory sizes.

one of those great little tools that epitomizes unix for me.

no kde libs, no gnome libs. simple and to the point.

use the *-a* switch to size individual files.


----------

