Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I monitor my /backups partition on my Debian-Lenny box?

I have sendmail and I would like to receive an email when my partition gets over, for instance, 80% of its total size.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Write simple script that sends e-mail if space usage gets over 80% and add it to crontab. On FreeBSD crond sends an e-mails with output of each called program, probably on Debian it does the same. If not - use any CLI e-mail client, mail(1) for example.

Example of script that checks space usage and prints warning if it is more that 80%:

df /backups | awk 'NR==2 {sub("%","",$5); if ($5 >= 80) {printf "Warning! Space usage is %d%%\n", $5}}' 
share|improve this answer
    
Ok, I get the idea. Thanks a lot ! –  Jonathan Rioux Jan 25 '11 at 16:00
add comment

Have a look at check_disk, which one of the nagios plugins. It is very flexible and the return codes are consistent. It's a tried and true solution.

I'm a big fan of nagios, but you don't need to install nagios server to use the plugins.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.