X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=clients%2FGD%2FFSMon%2Ffsmon.php;fp=clients%2FGD%2FFSMon%2Ffsmon.php;h=e7845690d266be987305e394ea82f504b0070d41;hb=a8c84d2892f07a6863b68a11eb0a4a79ffd71fb5;hp=0000000000000000000000000000000000000000;hpb=95384f94f88aceeb5eef2d322210ba4a438b6512;p=clearscm.git diff --git a/clients/GD/FSMon/fsmon.php b/clients/GD/FSMon/fsmon.php new file mode 100644 index 0000000..e784569 --- /dev/null +++ b/clients/GD/FSMon/fsmon.php @@ -0,0 +1,233 @@ + + + + + + + FSMon v($version) $sysLabel - $mountLabel + + +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 (getMounts ($system) as $item) { + print "$item"; + } // foreach + + print << +  Period:  + +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 (); +?> + +