END; $header .= banner (); $header .= <<
Filesystem Monitor END; return $header; } // createHeader function createPage ($system, $mount = "", $period = "daily", $scale = "gig") { $data = getFSInfo ($system, $mount, $period); $page .= <<
System
Mount Point
Timestamp
Size
Used
Free
Reserve
END; foreach ($data as $line) { $page .= <<
$line[sysname]
$line[mount]
$line[timestamp]
$line[size]
$line[used]
$line[free]
$line[reserve]
END; } // foreach $page .=<<
END; return $page; } // createPage function displayReport ($system = "", $mount = "", $period = "daily", $scale = "gig") { print createPage ($system, $mount, $period, $scale); } // displayReport function displayMount ($system = "", $mount = "", $period = "daily", $scale = "gig") { global $script; print <<
System:
END; foreach (getSystem () as $item) { print "
$item[name]
"; } // foreach print <<
Mount:
END; foreach (getMounts ($system) as $item) { print "
$item
"; } // foreach print <<
Period:
END; foreach (getPeriods () as $item) { print "
$item
"; } // foreach print <<
Scale:
END; foreach (getScales () as $item) { print "
$item
"; } // foreach print <<
END; // displayReport ($system, $mount, $period, $scale); } // displayMount function displayFilesystems ($system = "", $mount = "", $period = "daily", $scale = "gig") { if (empty ($mount)) { foreach (getMounts ($system) as $mount) { displayMount ($system, $mount, $period, $scale); print "
"; } // foreach } else { displayMount ($system, $mount, $period, $scale); } // if } // displayFilesystems function displayGraph ($system = "", $mount = "", $period = "daily", $scale = "gig") { print createHeader (); if (empty ($system)) { foreach (getSystem () as $system) { displayFilesystems ($system["name"], $mount, $period, $scale); } // foreach } else { displayFilesystems ($system, $mount, $period, $scale); } // if } // displayGraph openDB (); if (empty ($system)) { print createHeader (); print "
"; foreach (getSystem () as $system) { print "
$system[name]
"; // print "
"; // $mounts = getMounts ($system["name"]); // foreach ($mounts as $mount) { // print "
$mount
"; // } // foreach // print "
"; } // foreach print "
"; } else { displayGraph ($system, $mount, $period, $scale); } // if print copyright (); ?>