[Mon-commit] mon/mon.d freespace.monitor,1.1.1.1.2.1,1.1.1.1.2.2
Brought to you by:
trockij
From: Jim T. <tr...@us...> - 2006-12-13 16:07:03
|
Update of /cvsroot/mon/mon/mon.d In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30839/mon.d Modified Files: Tag: mon-1-0-0pre1 freespace.monitor Log Message: FL_ACKALERT and freespace.monitor Filesys::DiskFree Index: freespace.monitor =================================================================== RCS file: /cvsroot/mon/mon/mon.d/freespace.monitor,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** freespace.monitor 12 Apr 2005 21:28:00 -0000 1.1.1.1.2.1 --- freespace.monitor 13 Dec 2006 16:06:36 -0000 1.1.1.1.2.2 *************** *** 21,26 **** # to interrupt the stat and statfs system calls. # ! # This requires Fabien Tassin's Filesys::DiskSpace module, available from ! # your friendly neighborhood CPAN mirror. See http://www.perl.com/perl/ # # Jim Trocki, tr...@ar... --- 21,25 ---- # to interrupt the stat and statfs system calls. # ! #### Jason Castonguay jca...@so... # # Jim Trocki, tr...@ar... *************** *** 44,53 **** # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ! use Filesys::DiskSpace; foreach (@ARGV) { ($path, $minavail) = split (/:/, $_, 2); - ($fs_type, $fs_desc, $used, $avail, $fused, $favail) = df ($path); if (!defined ($used)) { --- 43,56 ---- # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ! use Filesys::DiskFree; foreach (@ARGV) { ($path, $minavail) = split (/:/, $_, 2); + + $handle = new Filesys::DiskFree; + $handle->df(); + $used = $handle->used($path); + $avail =$handle->avail($path); if (!defined ($used)) { *************** *** 61,65 **** if ($avail < $minavail) { ! push (@failures, sprintf ("%1.1fGB free on %s", $avail / 1024 / 1024, $path)); } --- 64,68 ---- if ($avail < $minavail) { ! push (@failures, sprintf ("%1.1fGB free on %s", $avail / 1024 / 1024 /1024, $path)); } *************** *** 72,73 **** --- 75,77 ---- exit 0; + |