diff --git a/html/graph.php b/html/graph.php index 7c3768aac..70fe6cc6e 100644 --- a/html/graph.php +++ b/html/graph.php @@ -75,8 +75,8 @@ if($_GET['debug']) { } if($graph) { - header('Content-type: image/png'); - $fd = fopen($graphfile,'r');fpassthru($fd);fclose($fd); +# header('Content-type: image/png'); +# $fd = fopen($graphfile,'r');fpassthru($fd);fclose($fd); } else { header('Content-type: image/png'); $string = "Graph Generation Error"; diff --git a/html/includes/graphs/cpmCPU.inc.php b/html/includes/graphs/cpmCPU.inc.php deleted file mode 100644 index 1b552d566..000000000 --- a/html/includes/graphs/cpmCPU.inc.php +++ /dev/null @@ -1,26 +0,0 @@ - diff --git a/html/includes/graphs/device_hrstorage.inc.php b/html/includes/graphs/device_hrstorage.inc.php index 679934def..cca571825 100644 --- a/html/includes/graphs/device_hrstorage.inc.php +++ b/html/includes/graphs/device_hrstorage.inc.php @@ -6,15 +6,15 @@ $scale_max = "100"; include("common.inc.php"); $iter = "1"; - $sql = mysql_query("SELECT * FROM storage where host_id = '$device_id'"); + $sql = mysql_query("SELECT * FROM storage where device_id = '$device_id'"); $rrd_options .= " COMMENT:' Size Used %age\\l'"; while($fs = mysql_fetch_array($sql)) { if($iter=="1") {$colour="CC0000";} elseif($iter=="2") {$colour="008C00";} elseif($iter=="3") {$colour="4096EE"; } elseif($iter=="4") {$colour="73880A";} elseif($iter=="5") {$colour="D01F3C";} elseif($iter=="6") {$colour="36393D"; } elseif($iter=="7") {$colour="FF0084"; $iter = "0"; } - $descr = substr(str_pad($fs[hrStorageDescr], 12),0,12); + $descr = substr(str_pad($fs[storage_descr], 12),0,12); $descr = str_replace(":","\:",$descr); - $rrd = $config['rrd_dir'] . "/$hostname/" . safename("hrStorage-".$fs['hrStorageIndex'].".rrd"); + $rrd = $config['rrd_dir'] . "/$hostname/" . safename("hrStorage-".$fs['storage_index'].".rrd"); $rrd_options .= " DEF:$fs[storage_id]=$rrd:used:AVERAGE"; $rrd_options .= " DEF:$fs[storage_id]s=$rrd:size:AVERAGE"; $rrd_options .= " DEF:$fs[storage_id]p=$rrd:perc:AVERAGE"; diff --git a/html/includes/graphs/hrProcessor.inc.php b/html/includes/graphs/hrProcessor.inc.php deleted file mode 100755 index be2c6b10f..000000000 --- a/html/includes/graphs/hrProcessor.inc.php +++ /dev/null @@ -1,27 +0,0 @@ - diff --git a/html/includes/graphs/hrstorage.inc.php b/html/includes/graphs/hrstorage.inc.php deleted file mode 100644 index 0fec446e7..000000000 --- a/html/includes/graphs/hrstorage.inc.php +++ /dev/null @@ -1,31 +0,0 @@ - diff --git a/html/pages/device.php b/html/pages/device.php index 0e3d3c846..419cc7ac9 100644 --- a/html/pages/device.php +++ b/html/pages/device.php @@ -39,7 +39,7 @@ echo('
  • '); -$health = mysql_result(mysql_query("select count(*) from storage WHERE host_id = '" . $device['device_id'] . "'"), 0) + +$health = mysql_result(mysql_query("select count(*) from storage WHERE device_id = '" . $device['device_id'] . "'"), 0) + mysql_result(mysql_query("select count(temp_id) from temperature WHERE device_id = '" . $device['device_id'] . "'"), 0) + mysql_result(mysql_query("select count(*) from cempMemPool WHERE device_id = '" . $device['device_id'] . "'"), 0) + mysql_result(mysql_query("select count(*) from cpmCPU WHERE device_id = '" . $device['device_id'] . "'"), 0) + @@ -137,7 +137,7 @@ if($config['enable_inventory'] && @mysql_result(mysql_query("SELECT * FROM `entP -#if(mysql_result(mysql_query("select count(storage_id) from storage WHERE host_id = '" . $device['device_id'] . "'"), 0) > '0') { +#if(mysql_result(mysql_query("select count(storage_id) from storage WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') { # echo(" #
  • # diff --git a/html/pages/device/graphs/hrstorage.inc.php b/html/pages/device/graphs/hrstorage.inc.php index fc0242784..dc1586d3d 100644 --- a/html/pages/device/graphs/hrstorage.inc.php +++ b/html/pages/device/graphs/hrstorage.inc.php @@ -1,6 +1,6 @@ diff --git a/html/pages/device/health/cemp.inc.php b/html/pages/device/health/cemp.inc.php deleted file mode 100644 index 48bcddff7..000000000 --- a/html/pages/device/health/cemp.inc.php +++ /dev/null @@ -1,62 +0,0 @@ -"); - echo(""); - $i = '1'; - $mempools = mysql_query("SELECT * FROM `cempMemPool` WHERE device_id = '" . $device['device_id'] . "'"); - while($mempool = mysql_fetch_array($mempools)) { - if(!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } - $entPhysicalName = mysql_result(mysql_query("SELECT entPhysicalName from entPhysical WHERE device_id = '".$device['device_id']."' - AND entPhysicalIndex = '".$mempool['entPhysicalIndex']."'"),0); - $perc = round($mempool['cempMemPoolUsed'] / ($mempool['cempMemPoolUsed'] + $mempool['cempMemPoolFree']) * 100,2); - $mempool['descr_fixed'] = $entPhysicalName . " ". $mempool['cempMemPoolName']; -# $mempool['descr_fixed'] = str_replace("Routing Processor", "RP", $mempool['descr_fixed']); -# $mempool['descr_fixed'] = str_replace("Switching Processor", "SP", $mempool['descr_fixed']); -# $mempool['descr_fixed'] = str_replace("Processor", "Proc", $mempool['descr_fixed']); - - $proc_url = "?page=device/".$device['device_id']."/sensors/mempools/"; - - $mempool_popup = "onmouseover=\"return overlib('
    ".$device['hostname']." - ".$mempool['descr_fixed']; - $mempool_popup .= "
    "; - $mempool_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\""; - - - if($mempool['cpuCPMTotal5minRev'] > '60') { $mempool_colour='#cc0000'; } else { $mempool_colour='#0000cc'; } - echo(" - - - - "); - - echo(""); - - - $i++; - } - echo("
    " . $mempool['descr_fixed'] ."$perc%" . formatstorage($mempool['cempMemPoolFree'], 0) . "/" . formatstorage($mempool['cempMemPoolUsed'] + $mempool['cempMemPoolFree'], 0) . "
    "); - - $daily_graph = "graph.php?id=" . $mempool['cempMemPool_id'] . "&type=cempMemPool&from=$day&to=$now&width=211&height=100"; - $daily_url = "graph.php?id=" . $mempool['cempMemPool_id'] . "&type=cempMemPool&from=$day&to=$now&width=400&height=150"; - - $weekly_graph = "graph.php?id=" . $mempool['cempMemPool_id'] . "&type=cempMemPool&from=$week&to=$now&width=211&height=100"; - $weekly_url = "graph.php?id=" . $mempool['cempMemPool_id'] . "&type=cempMemPool&from=$week&to=$now&width=400&height=150"; - - $monthly_graph = "graph.php?id=" . $mempool['cempMemPool_id'] . "&type=cempMemPool&from=$month&to=$now&width=211&height=100"; - $monthly_url = "graph.php?id=" . $mempool['cempMemPool_id'] . "&type=cempMemPool&from=$month&to=$now&width=400&height=150"; - - $yearly_graph = "graph.php?id=" . $mempool['cempMemPool_id'] . "&type=cempMemPool&from=$year&to=$now&width=211&height=100"; - $yearly_url = "graph.php?id=" . $mempool['cempMemPool_id'] . "&type=cempMemPool&from=$year&to=$now&width=400&height=150"; - - echo("', LEFT);\" onmouseout=\"return nd();\"> - "); - echo("', LEFT);\" onmouseout=\"return nd();\"> - "); - echo("', LEFT);\" onmouseout=\"return nd();\"> - "); - echo("', LEFT);\" onmouseout=\"return nd();\"> - "); - echo("
    "); - echo(""); - - -?> diff --git a/html/pages/device/health/cmp.inc.php b/html/pages/device/health/cmp.inc.php deleted file mode 100644 index 6487b1714..000000000 --- a/html/pages/device/health/cmp.inc.php +++ /dev/null @@ -1,55 +0,0 @@ -"); - echo(""); - $i = '1'; - $mempools = mysql_query("SELECT * FROM `cmpMemPool` WHERE device_id = '" . $device['device_id'] . "'"); - while($mempool = mysql_fetch_array($mempools)) { - if(!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } - - $perc = round($mempool['cmpUsed'] / ($mempool['cmpUsed'] + $mempool['cmpFree']) * 100,2); - - $proc_url = "?page=device/".$device['device_id']."/sensors/mempools/"; - - $mempool_popup = "onmouseover=\"return overlib('
    ".$device['hostname']." - ".$mempool['cmpName']; - $mempool_popup .= "
    "; - $mempool_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\""; - - if($mempool['cpuCPMTotal5minRev'] > '60') { $mempool_colour='#cc0000'; } else { $mempool_colour='#0000cc'; } - echo(" - - - - "); - - echo(""); - - $i++; - } - echo("
    " . $mempool['cmpName'] ."$perc%" . formatstorage($mempool['cmpFree'], 0) . "/" . formatstorage($mempool['cmpUsed'] + $mempool['cmpFree'], 0) . "
    "); - - $daily_graph = "graph.php?id=" . $mempool['cmp_id'] . "&type=cmpMemPool&from=$day&to=$now&width=211&height=100"; - $daily_url = "graph.php?id=" . $mempool['cmp_id'] . "&type=cmpMemPool&from=$day&to=$now&width=400&height=150"; - - $weekly_graph = "graph.php?id=" . $mempool['cmp_id'] . "&type=cmpMemPool&from=$week&to=$now&width=211&height=100"; - $weekly_url = "graph.php?id=" . $mempool['cmp_id'] . "&type=cmpMemPool&from=$week&to=$now&width=400&height=150"; - - $monthly_graph = "graph.php?id=" . $mempool['cmp_id'] . "&type=cmpMemPool&from=$month&to=$now&width=211&height=100"; - $monthly_url = "graph.php?id=" . $mempool['cmp_id'] . "&type=cmpMemPool&from=$month&to=$now&width=400&height=150"; - - $yearly_graph = "graph.php?id=" . $mempool['cmp_id'] . "&type=cmpMemPool&from=$year&to=$now&width=211&height=100"; - $yearly_url = "graph.php?id=" . $mempool['cmp_id'] . "&type=cmpMemPool&from=$year&to=$now&width=400&height=150"; - - echo("', LEFT);\" onmouseout=\"return nd();\"> - "); - echo("', LEFT);\" onmouseout=\"return nd();\"> - "); - echo("', LEFT);\" onmouseout=\"return nd();\"> - "); - echo("', LEFT);\" onmouseout=\"return nd();\"> - "); - echo("
    "); - echo(""); - - -?> diff --git a/html/pages/device/health/hrprocessors.inc.php b/html/pages/device/health/hrprocessors.inc.php deleted file mode 100644 index b13d4c689..000000000 --- a/html/pages/device/health/hrprocessors.inc.php +++ /dev/null @@ -1,52 +0,0 @@ -"); - echo(""); - $i = '1'; - $procs = mysql_query("SELECT * FROM `hrDevice` WHERE device_id = '" . $device['device_id'] . "' AND hrDeviceType = 'hrDeviceProcessor'"); - while($proc = mysql_fetch_array($procs)) { - - $proc_url = "?page=device/".$device['device_id']."/health/hrprocessors/"; - - $proc_popup = "onmouseover=\"return overlib('
    ".$device['hostname']." - ".$proc['entPhysicalDescr']; - $proc_popup .= "
    "; - $proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\""; - - if($proc['cpuCPMTotal5minRev'] > '60') { $proc_colour='#cc0000'; } else { $proc_colour='#0000cc'; } - echo(" - - - "); - - echo(""); - - $i++; - } - echo("
    " . $proc['hrDeviceDescr'] . " - " . $proc['hrProcessorLoad'] . "%
    "); - - $daily_graph = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$day&to=$now&width=211&height=100"; - $daily_url = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$day&to=$now&width=400&height=150"; - - $weekly_graph = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$week&to=$now&width=211&height=100"; - $weekly_url = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$week&to=$now&width=400&height=150"; - - $monthly_graph = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$month&to=$now&width=211&height=100"; - $monthly_url = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$month&to=$now&width=400&height=150"; - - $yearly_graph = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$year&to=$now&width=211&height=100"; - $yearly_url = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$year&to=$now&width=400&height=150"; - - echo("', LEFT);\" onmouseout=\"return nd();\"> - "); - echo("', LEFT);\" onmouseout=\"return nd();\"> - "); - echo("', LEFT);\" onmouseout=\"return nd();\"> - "); - echo("', LEFT);\" onmouseout=\"return nd();\"> - "); - echo("
    "); - echo(""); - - -?> diff --git a/html/pages/device/health/processors.inc.php b/html/pages/device/health/processors.inc.php index feddcf450..4a6d02f81 100644 --- a/html/pages/device/health/processors.inc.php +++ b/html/pages/device/health/processors.inc.php @@ -8,16 +8,30 @@ $proc_url = "?page=device/".$device['device_id']."/health/processors/"; - $proc_popup = "onmouseover=\"return overlib('
    ".$device['hostname']." - ".$proc['processor_descr']; - $proc_popup .= "
    "; + $mini_url = $config['base_url'] . "/graph.php?id=".$proc['processor_id']."&type=processor&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; + + + + $proc_popup = "onmouseover=\"return overlib('
    ".$device['hostname']." - ".$text_descr; + $proc_popup .= "
    "; $proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\""; - if($proc['processor_usage'] > '60') { $proc_colour='#cc0000'; } else { $proc_colour='#0000cc'; } - echo("
    " . $proc['processor_descr'] . " - - - " . $proc['processor_usage'] . "% + $perc = round($proc['processor_usage']); + + if($perc > '90') { $left_background='c4323f'; $right_background='C96A73'; + } elseif($perc > '75') { $left_background='bf5d5b'; $right_background='d39392'; + } elseif($perc > '50') { $left_background='bf875b'; $right_background='d3ae92'; + } elseif($perc > '25') { $left_background='5b93bf'; $right_background='92b7d3'; + } else { $left_background='9abf5b'; $right_background='bbd392'; } + + echo("" . $text_descr . " + + + ".print_percentage_bar (400, 20, $perc, $perc."%", "ffffff", $left_background, (100 - $perc)."%" , "ffffff", $right_background)." + "); + + echo(""); diff --git a/html/pages/device/health/storage.inc.php b/html/pages/device/health/storage.inc.php index 46a661934..0f8fe2bab 100644 --- a/html/pages/device/health/storage.inc.php +++ b/html/pages/device/health/storage.inc.php @@ -1,6 +1,6 @@ "); @@ -18,9 +18,9 @@ while($drive = mysql_fetch_array($query)) { if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } - $total = $drive['hrStorageSize'] * $drive['hrStorageAllocationUnits']; - $used = $drive['hrStorageUsed'] * $drive['hrStorageAllocationUnits']; - $free = $total - $drive['hrStorageUsed'] * $drive['hrStorageAllocationUnits']; + $total = $drive['storage_size'] * $drive['storage_units']; + $used = $drive['storage_used'] * $drive['storage_units']; + $free = $total - $drive['storage_used'] * $drive['storage_units']; $perc = round($drive['storage_perc'], 0); $used = formatStorage($used); $total = formatStorage($total); @@ -28,8 +28,8 @@ while($drive = mysql_fetch_array($query)) { $fs_url = "?page=device&id=".$device['device_id']."§ion=dev-storage"; - $fs_popup = "onmouseover=\"return overlib('
    ".$device['hostname']." - ".$drive['hrStorageDescr']; - $fs_popup .= "
    "; + $fs_popup = "onmouseover=\"return overlib('
    ".$device['hostname']." - ".$drive['storage_descr']; + $fs_popup .= "
    "; $fs_popup .= "', RIGHT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\""; if($perc > '90') { $left_background='c4323f'; $right_background='C96A73'; @@ -38,12 +38,12 @@ while($drive = mysql_fetch_array($query)) { } elseif($perc > '25') { $left_background='5b93bf'; $right_background='92b7d3'; } else { $left_background='9abf5b'; $right_background='bbd392'; } - echo("" . $drive['hrStorageDescr'] . " + echo("" . $drive['storage_descr'] . " ".print_percentage_bar (400, 20, $perc, "$used / $total", "ffffff", $left_background, $perc . "%", "ffffff", $right_background)." " . $free . ""); - $graph_type = "hrstorage"; + $graph_type = "storage"; // start temperature graphs @@ -61,13 +61,13 @@ while($drive = mysql_fetch_array($query)) { echo(""); - echo("".$device['hostname']." - ".$drive['hrStorageDescr']."', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"> + echo("".$device['hostname']." - ".$drive['storage_descr']."', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"> "); - echo("".$device['hostname']." - ".$drive['hrStorageDescr']."', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"> + echo("".$device['hostname']." - ".$drive['storage_descr']."', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"> "); - echo("".$device['hostname']." - ".$drive['hrStorageDescr']."', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"> + echo("".$device['hostname']." - ".$drive['storage_descr']."', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"> "); - echo("".$device['hostname']." - ".$drive['hrStorageDescr']."', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"> + echo("".$device['hostname']." - ".$drive['storage_descr']."', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"> "); echo(""); diff --git a/html/pages/device/overview.inc.php b/html/pages/device/overview.inc.php index 575ca64b0..5a50f628d 100644 --- a/html/pages/device/overview.inc.php +++ b/html/pages/device/overview.inc.php @@ -75,7 +75,8 @@ include("overview/processors.inc.php"); include("overview/mempools.inc.php"); #include("overview/cemp.inc.php"); #include("overview/cmp.inc.php"); -include("overview/hrStorage.inc.php"); +#include("overview/hrStorage.inc.php"); +include("overview/storage.inc.php"); include("overview/temperatures.inc.php"); include("overview/fanspeeds.inc.php"); include("overview/voltages.inc.php"); diff --git a/html/pages/device/overview/hrProcessors.inc.php b/html/pages/device/overview/hrProcessors.inc.php deleted file mode 100644 index 97b672ddc..000000000 --- a/html/pages/device/overview/hrProcessors.inc.php +++ /dev/null @@ -1,33 +0,0 @@ -"); - echo("

    Processors

    "); - echo(""); - $i = '1'; - $procs = mysql_query("SELECT * FROM `hrDevice` WHERE device_id = '" . $device['device_id'] . "' AND hrDeviceType = 'hrDeviceProcessor'"); - while($proc = mysql_fetch_array($procs)) { - - $proc_url = "?page=device/".$device['device_id']."/health/hrprocessors/"; - - $proc_popup = "onmouseover=\"return overlib('
    ".$device['hostname']." - ".$proc['entPhysicalDescr']; - $proc_popup .= "
    "; - $proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\""; - - $text_descr = short_hrDeviceDescr($proc['hrDeviceDescr']); - - if($proc['hrProcessorLoad'] > '60') { $proc_colour='#cc0000'; } else { $proc_colour='#0000cc'; } - echo(" - - - "); - $i++; - } - echo("
    " . $text_descr . " - - " . $proc['hrProcessorLoad'] . "%
    "); - echo(""); -} - -?> diff --git a/html/pages/device/overview/hrStorage.inc.php b/html/pages/device/overview/hrStorage.inc.php deleted file mode 100644 index 248efbd6f..000000000 --- a/html/pages/device/overview/hrStorage.inc.php +++ /dev/null @@ -1,58 +0,0 @@ -"); - echo("

    Storage

    "); - echo(""); - $drive_rows = '0'; - - $drives = mysql_query("SELECT * FROM `storage` WHERE host_id = '" . $device['device_id'] . "'"); - while($drive = mysql_fetch_array($drives)) { - - $skipdrive = 0; - - if ($device["os"] == "junos") { - foreach ($config['ignore_junos_os_drives'] as $jdrive) { - if (preg_match($jdrive, $drive["hrStorageDescr"])) { - $skipdrive = 1; - } - } - } - - if ($skipdrive) { continue; } - if(is_integer($drive_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } - $total = $drive['hrStorageSize'] * $drive['hrStorageAllocationUnits']; - $used = $drive['hrStorageUsed'] * $drive['hrStorageAllocationUnits']; - $perc = round($drive['storage_perc'], 0); - $total = formatStorage($total); - $used = formatStorage($used); - - $fs_url = "/device/".$device['device_id']."/health/storage/"; - - $fs_popup = "onmouseover=\"return overlib('
    ".$device['hostname']." - ".$drive['hrStorageDescr']; - $fs_popup .= "
    "; - $fs_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\""; - - $mini_graph = $config['base_url'] . "/graph.php?id=".$drive['storage_id']."&type=hrstorage&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; - - - - if($perc > '90') { $left_background='c4323f'; $right_background='C96A73'; - } elseif($perc > '75') { $left_background='bf5d5b'; $right_background='d39392'; - } elseif($perc > '50') { $left_background='bf875b'; $right_background='d3ae92'; - } elseif($perc > '25') { $left_background='5b93bf'; $right_background='92b7d3'; - } else { $left_background='9abf5b'; $right_background='bbd392'; } - - echo(" - - - "); - $drive_rows++; - } - echo("
    " . $drive['hrStorageDescr'] . "".print_percentage_bar (200, 20, $perc, "$used / $total", "ffffff", $left_background, $perc . "%", "ffffff", $right_background)."
    "); - echo(""); -} - -unset ($drive_rows); - -?> diff --git a/html/pages/device/storage.inc.php b/html/pages/device/storage.inc.php deleted file mode 100644 index 888a1ad81..000000000 --- a/html/pages/device/storage.inc.php +++ /dev/null @@ -1,85 +0,0 @@ -"); - -echo(" - Drive - Usage - Used - Total - Free - - "); - -$row = 1; - -while($drive = mysql_fetch_array($query)) { - - if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } - - $total = $drive['hrStorageSize'] * $drive['hrStorageAllocationUnits']; - $used = $drive['hrStorageUsed'] * $drive['hrStorageAllocationUnits']; - $perc = round($drive['storage_perc'], 0); - $total = formatStorage($total); - $used = formatStorage($used); - - $fs_url = "?page=device&id=".$device['device_id']."§ion=dev-storage"; - - if($perc > '90') { $left_background='c4323f'; $right_background='C96A73'; - } elseif($perc > '75') { $left_background='bf5d5b'; $right_background='d39392'; - } elseif($perc > '50') { $left_background='bf875b'; $right_background='d3ae92'; - } elseif($perc > '25') { $left_background='5b93bf'; $right_background='92b7d3'; - } else { $left_background='9abf5b'; $right_background='bbd392'; } - - $fs_popup = "onmouseover=\"return overlib('
    ".$device['hostname']." - ".$drive['hrStorageDescr']; - $fs_popup .= "
    "; - $fs_popup .= "', RIGHT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\""; - - $drv_colour = percent_colour($perc); - - echo("" . $drive['hrStorageDescr'] . " - ".print_percentage_bar (200, 16, $perc, "$used / $total", "ffffff", $left_background, $perc . "%", "ffffff", $right_background)." - " . $perc . "%" . $total . "" . $used . ""); - - - $graph_type = "unixfs"; - -// start temperature graphs - - $daily_temp = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$day&to=$now&width=212&height=100"; - $daily_url = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$day&to=$now&width=400&height=150"; - - $weekly_temp = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$week&to=$now&width=212&height=100"; - $weekly_url = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$week&to=$now&width=400&height=150"; - - $monthly_temp = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$month&to=$now&width=212&height=100"; - $monthly_url = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$month&to=$now&width=400&height=150"; - - $yearly_temp = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$year&to=$now&width=212&height=100"; - $yearly_url = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$year&to=$now&width=400&height=150"; - - echo(""); - - echo("".$device['hostname']." - ".$drive['hrStorageDescr']."', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"> - "); - echo("".$device['hostname']." - ".$drive['hrStorageDescr']."', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"> - "); - echo("".$device['hostname']." - ".$drive['hrStorageDescr']."', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"> - "); - echo("".$device['hostname']." - ".$drive['hrStorageDescr']."', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"> - "); - - echo(""); - - - $row++; - -} - -echo(""); - - -?> diff --git a/html/pages/storage.php b/html/pages/storage.php index 968d9205c..6115ffc06 100644 --- a/html/pages/storage.php +++ b/html/pages/storage.php @@ -1,10 +1,10 @@ = '5') { - $sql = "SELECT * FROM `storage` AS S, `devices` AS D WHERE S.host_id = D.device_id ORDER BY D.hostname, S.hrStorageDescr"; + $sql = "SELECT * FROM `storage` AS S, `devices` AS D WHERE S.device_id = D.device_id ORDER BY D.hostname, S.storage_descr"; } else { - $sql = "SELECT * FROM `storage` AS S, `devices` AS D, devices_perms as P WHERE D.host_id = D.device_id AND "; - $sql .= "D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, S.hrStorageDescr"; + $sql = "SELECT * FROM `storage` AS S, `devices` AS D, devices_perms as P WHERE D.device_id = D.device_id AND "; + $sql .= "D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, S.storage_descr"; } $query = mysql_query($sql); @@ -12,12 +12,13 @@ $query = mysql_query($sql); echo("
    "); -echo(" - - - - - "); +#echo(" +# +# +# +# +# +# "); $row = 1; @@ -27,7 +28,7 @@ while($drive = mysql_fetch_array($query)) { if ($drive["os"] == "junos") { foreach ($config['ignore_junos_os_drives'] as $jdrive) { - if (preg_match($jdrive, $drive["hrStorageDescr"])) { + if (preg_match($jdrive, $drive["storage_descr"])) { $skipdrive = 1; } } @@ -36,16 +37,18 @@ while($drive = mysql_fetch_array($query)) { if ($skipdrive) { continue; } if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } - $total = $drive['hrStorageSize'] * $drive['hrStorageAllocationUnits']; - $used = $drive['hrStorageUsed'] * $drive['hrStorageAllocationUnits']; - $free = $total - $used; + $total = $drive['storage_size']; + $used = $drive['storage_used']; + $free = $drive['storage_free']; $perc = round($drive['storage_perc'], 0); $total = formatStorage($total); $used = formatStorage($used); - $store_url = "graph.php?id=" . $drive['storage_id'] . "&type=hrstorage&from=$month&to=$now&width=400&height=125"; + $store_url = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$month&to=$now&width=400&height=125"; $store_popup = "onmouseover=\"return overlib('', LEFT);\" onmouseout=\"return nd();\""; + $mini_graph = $config['base_url'] . "/graph.php?id=".$drive['storage_id']."&type=storage&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; + if($perc > '90') { $left_background='c4323f'; $right_background='C96A73'; } elseif($perc > '75') { $left_background='bf5d5b'; $right_background='d39392'; } elseif($perc > '50') { $left_background='bf875b'; $right_background='d3ae92'; @@ -53,9 +56,11 @@ while($drive = mysql_fetch_array($query)) { } else { $left_background='9abf5b'; $right_background='bbd392'; } - echo(""); + echo(" + + "); $row++;
    DeviceStorageUsageFree
    DeviceStorageUsageUsed
    " . generatedevicelink($drive) . "" . $drive['hrStorageDescr'] . " - ".print_percentage_bar (400, 20, $perc, "$used / $total", "ffffff", $left_background, $perc . "%", "ffffff", $right_background)." - " . formatStorage($free) . "
    " . generatedevicelink($drive) . "" . $drive['storage_descr'] . " + ".print_percentage_bar (400, 20, $perc, "$used / $total", "ffffff", $left_background, formatStorage($free), "ffffff", $right_background)." + $perc"."%