[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Monitor file system free space



I'm not sure what the scope of the discussion is (ie: mail server for
personal use vs. a company mail server) so what I do might be overkill
for you if you run a home server.

Anyways, I run net-snmpd to pull system information which I then use
nagios to check. If disk usage goes above a certain threshold for a
certain partition, Nagios can send me emails and sms's. If anyone needs
more details as to exactly what I do, I can post more details.

Following the discussion below, a simple bash script can email you the
current usage of the disk space (take out the awk portion if you want to
see the whole line). If you want more logic, it shouldn't be hard to
modify what I have below to email you only when disk used > certain
size.

#!/bin/bash
df -h | head -n 2 | tail -n 1 | awk '{print $4}' | mail -s "Mail server"
REMOTE email address


-----Original Message-----
From: David Baron [mailto:d_baron@012.net.il] 
Sent: December 22, 2009 11:07 AM
To: debian-user@lists.debian.org
Subject: Re: Monitor file system free space

On Tuesday 22 December 2009 17:25:55 debian-user-digest-
request@lists.debian.org wrote:
> > I had a problem with my (small) disk filling up and crashing my mail

> > server.  So, I wrote a simple perl script to take the output of 'df
-h'
> > and look for a % full that is greater than 97% and send me an e-mail

> > if the % is greater than 97.  I run the script daily from crontab.  
> > It works fine.
> >
> > Yesterday I downloaded an iso image (which brought the file system 
> > fill from 93% to 100% so that the mail server could not send me the 
> > e-mail warning.  Is there another way to approach this problem (a 
> > different tool?)so that I can be notified BEFORE the file system is
too full?
> 
> If your mail server is important ( ;-) ), put your mails and/or all of

> /var on a separate partition, maybe with quotas.
> 
> Do the same for /home.
> 

As I have had those mouse syslogs filling up /var which cripples
anything that touches logs, mail, runs, pids, in other words,
everything. So a monitor like this would be very useful. The monitor
would need to check partitions in a conf file and then take action if
any are filled. In the case of /var, messaging, mailing, most anything
will not work unless I set the limit low enough. But that's the whole
point.

Maybe post your perl.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact
listmaster@lists.debian.org


Reply to: