
VBTK::Wrapper::DiskFree - Sun hardware disk space monitoring with 'df'

# If you like all the defaults, then there's no need to over-ride them. $o = new VBTK::Wrapper::DiskFree (); $vbObj = $o->addVBObj(); VBTK::runAll;

This perl library is a front-end to the VBTK::Wrapper class. It supports the same public methods as the VBTK::Wrapper class, but with common defaults to simplify the setup of a 'df' monitoring process.

The following methods are supported
::TBD::
This method calls 'new VBTK::Wrapper' after defaulting the parameters to best monitor the 'df' command. For a detailed description of the parameters, see VBTK::Wrapper. The defaults are as follows. If you like all the defaults then you don't have to pass in any parms.
Interval => 300,
Execute => '/usr/bin/df -k 2>&1',
VBHeader => [
'Time Mount MB Used Avail Pct',
'------------------ -------------------------- ------ ------ ------ ----' ],
VBDetail => [
'@<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<< @>>>>> @>>>>> @>>>>> @>>>',
'$time, $data[5], int($data[1]/1024), int($data[2]/1024), int($data[3]/1024), $data[4]' ],
Same as VBHeader, but used for the log file.
Same as VBDetail, but used for the log file.
Split => '\s+',
Only accept the lines which begin in '/dev' (Unix) or '<x>:' (Windows).
Filter => '^/dev|^[A-Za-z]:\s+',
Ignore the CD-rom drive if it shows up in the output
Ignore => '/cdrom',
Timeout => 60,
TimeoutStatus => 'Fail',
NonZeroExitStatus => 'Warn',
DebugHeader => 'prtdiag',
This method runs the above wrapper object once to determine how many filesystems reside on the local host. For each filesystem found, a separate VB object is created by calling VBTK::Wrapper::addVBObj after defaulting unspecified parameters to best monitor diskspace with the 'df' command. For a detailed description of the addVBObj parameters, see VBTK::Parser. The defaults are as follows. If you like all the defaults then you don't have to pass in any parms
Name the VBObject using the local host's name.
VBObjName => ".<Host>.diskfree.<filesystem>",
TextHistoryLimit => 50,
ReverseText => 1,
If space used exceeds 90%, set to warn. If above 95%, set to Failed.
Rules => {
'($data[4] > 90)' => 'Warn',
'($data[4] > 95)' => 'Fail' },
Limit to storing the last 30 status changes
StatusHistoryLimit => 30,
ExpireAfter => "(<Interval> * 3) seconds"
Description = qq(
This object uses the 'df' command to monitor the disk utilization on
$::HOST. It will set the status to 'Warning' or 'Failed' based on the
amount of free disk space on the local filesystems. ),
Graph the pct utilization for each filesytem.
RrdColumns => [ 'int($data[4])' ],
RrdMin => 0,
Use the 'MAX' consolidation function so that we see peaks, rather than averages, in the graphs.
RrdCF => 'MAX',
In addition to passing these defaults on in a call to VBTK::Wrapper::addVBObj, this method captures the resulting VBTK::ClientObject pointer ($vbObj) and makes the following call to '$vbObj->addGraphGroup':
$vbObj->addGraphGroup (
GroupNumber => 1,
Labels => 'pct-utilization',
Title => 'Disk Utilization on <Host>, <filesystem>',
CF => 'MAX',
);
This defines a graphGroup for the VBObject. See VBTK::ClientObject for details on the 'addGraphGroup' method.
A second call to 'addGraphGroup' is then made which combines all filesystems for this host into a single graph group.
$vbObj->addGraphGroup (
GroupNumber => 2,
DataSourceList => <built from list of filesystems>,
Labels => <build from list of filesystems>,
Title => "Disk Utilization on <Host>",
CF => 'MAX',
);

VBTK, VBTK::Wrapper, VBTK::Parser, VBTK::ClientObject, VBTK::Server

Brent Henry, vbtoolkit@yahoo.com

Copyright (C) 1996-2002 Brent Henry
This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation available at: http://http://www.gnu.org/copyleft/gpl.html
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.