1820636 Members
1853 Online
109626 Solutions
New Discussion юеВ

file system monitoring

 
nibble
Super Advisor

file system monitoring

guys, any idea how to make a fs monitoring that is automated? my idea is tru cronjob...

what i want is to monitor all the fs in a box, then set a limit of 70% threshold. once an FS reach 70% or more, it will automatically inform me via email... or any other means of alert..

contents of the alert will be the system name, the FS that is full, etc...
10 REPLIES 10
Ralf Seefeldt
Valued Contributor

Re: file system monitoring

Hi,

yes, You can either use a cronjob or an entry in /etc/inittab with a looping script.

Alternativeley, you may use some tools like for example nagios, which are able to monitor many more aspects of the computer, send the results of the monitoring to a central server, support a GUI and offer several ways to inform you about problems of several grades of seriousness.

This may bo a lot mor work to install and configure, but it pays out, if you can use more of its features.

Bye
Ralf
Shaikh Imran
Honored Contributor

Re: file system monitoring

Hi,
Why don't you try HP-Openview NNM

Regards,

I'll sleep when i am dead.
Sanjay Kumar Suri
Honored Contributor

Re: file system monitoring

Check this thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=85993

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Jose Mosquera
Honored Contributor

Re: file system monitoring

Hi,

Each time that root user enter into the machine a very simple procedure run into .profile:

WARNING_PERC=90
echo "Verifying File System spaces ......... \c"
BDF=`bdf|grep $WARNING_PERC%|wc -l`
if [ $BDF -eq 0 ]
then
echo "[Ok]"
else
echo "[File System Warning]"
fi

A similar checking will be done by a cronned task and sending an email via mailx or sendmail.

Rgds.
Fabio Ettore
Honored Contributor

Re: file system monitoring

Hi Nibble,

in attachment a good script, just insert the mail address.
You can launch it as a cronjob too.

HTH.

Best regards,
Ettore
WISH? IMPROVEMENT!
Bill Hassell
Honored Contributor

Re: file system monitoring

As mentioned, HP's OpenView products are designed for exactly this task. However, they are are priced product and will require much more time to setup than Nagios. I have a ttached a simple script that can be customized with a config file to specify different limits for different filesystems. It has the ability to notify by email, by syslog entry, or with a call to opcmsg to log an entry with OpenView ITO. The script keeps track of the highwater mark and won't keep sending the same message over and over if nothing changes. You can set the increment where once over the limit, say 70%, then the next message goes out at 75% or 80% (configurable). Just put it into a cron job, running every 10 or 20 minutes. Don't run it every few minutes as bdf can create quite a load on the system for a few seconds. To prevent hangs from NFS, the config file enumerates the filesystem types (vxfs hfs) to be scanned (leave out network filesystems)


Bill Hassell, sysadmin
Abdul Rahiman
Esteemed Contributor

Re: file system monitoring

Here is a simple one line script that could be put in cron to run every 10-15 minutes to check filesystems filling up more than 70%.

bdf | awk 'split($5,a,"%") && a[1] > 70 {print $5, $6}' | mailx -s "Diskspace Alert: `hostname`" email@urcompany.com
No unix, no fun
Thierry Poels_1
Honored Contributor

Re: file system monitoring

Hi,

you cannot solely rely on percentages, can you? If you have a 200GB file system with 1% free space you have still room enough to play around. On the other hand if you have a 100MB file system with 10% free space then you're in tight shoes.

Just my 2 cents
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Kim Kendall
Regular Advisor

Re: file system monitoring

Here is a sample script that I use (run from cron). It allows you to adjust the threshold based on filesystem name, just add the different filesystems you want to monitor.
Paul Sperry
Honored Contributor

Re: file system monitoring

Check out BigBrother I use it to moniter all of my systems (over 100) both unix and windows.

www.bb4.org

There is a free version (which I use)
and a "pro" version that you have to buy.