mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
replace old hrStorage poller with generic storage poller and hrStorage plugin
*** OLD RRDFILES ARE USELESS NOW*** remove a load of old processor and storage stuff add more % bars to things git-svn-id: http://www.observium.org/svn/observer/trunk@936 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
+2
-2
@@ -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";
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
$scale_min = "0";
|
||||
$scale_max = "100";
|
||||
|
||||
include("common.inc.php");
|
||||
|
||||
$iter = "1";
|
||||
|
||||
$sql = mysql_query("SELECT * FROM `cpmCPU` AS C, `devices` AS D where C.`cpmCPU_id` = '".mres($_GET['id'])."' AND C.device_id = D.device_id");
|
||||
$rrd_options .= " COMMENT:' Cur Max\\n'";
|
||||
while($proc = 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"; unset($iter); }
|
||||
$proc['descr_fixed'] = str_pad($proc['entPhysicalDescr'], 28);
|
||||
$proc['descr_fixed'] = substr($proc['descr_fixed'],0,28);
|
||||
$rrd = $config['rrd_dir'] . "/".$proc['hostname']."/" . safename("cpmCPU-" . $proc['cpmCPU_oid'] . ".rrd");
|
||||
$rrd_options .= " DEF:proc" . $proc['cpmCPU_oid'] . "=$rrd:usage:AVERAGE ";
|
||||
$rrd_options .= " LINE1:proc" . $proc['cpmCPU_oid'] . "#" . $colour . ":'" . $proc['descr_fixed'] . "' ";
|
||||
$rrd_options .= " GPRINT:proc" . $proc['cpmCPU_oid'] . ":LAST:%3.0lf";
|
||||
$rrd_options .= " GPRINT:proc" . $proc['cpmCPU_oid'] . ":MAX:%3.0lf\\\l ";
|
||||
$iter++;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -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";
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
$scale_min = "0";
|
||||
$scale_max = "100";
|
||||
|
||||
include("common.inc.php");
|
||||
|
||||
$iter = "1";
|
||||
|
||||
$sql = mysql_query("SELECT * FROM `hrDevice` AS C, `devices` AS D where C.`hrDevice_id` = '".mres($_GET['id'])."' AND C.device_id = D.device_id");
|
||||
$rrd_options .= " COMMENT:' Cur Max\\n'";
|
||||
while($proc = 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"; unset($iter); }
|
||||
$proc['descr_fixed'] = substr(str_pad(short_hrDeviceDescr($proc['hrDeviceDescr']), 28),0,28);
|
||||
$proc['descr_fixed'] = str_replace(":", "\:", $proc['descr_fixed']);
|
||||
$rrd = $config['rrd_dir'] . "/".$proc['hostname']."/" . safename("hrProcessor-" . $proc['hrDeviceIndex'] . ".rrd");
|
||||
$rrd_options .= " DEF:proc" . $proc['hrDeviceIndex'] . "=$rrd:usage:AVERAGE ";
|
||||
$rrd_options .= " LINE1:proc" . $proc['hrDeviceIndex'] . "#" . $colour . ":'" . $proc['descr_fixed'] . "' ";
|
||||
$rrd_options .= " GPRINT:proc" . $proc['hrDeviceIndex'] . ":LAST:%3.0lf";
|
||||
$rrd_options .= " GPRINT:proc" . $proc['hrDeviceIndex'] . ":MAX:%3.0lf\\\l ";
|
||||
$iter++;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
$scale_min = "0";
|
||||
$scale_max = "100";
|
||||
|
||||
include("common.inc.php");
|
||||
|
||||
$rrd_options .= " -b 1024";
|
||||
|
||||
$iter = "1";
|
||||
$sql = mysql_query("SELECT * FROM storage where storage_id = '".mres($_GET['id'])."'");
|
||||
$rrd_options .= " COMMENT:' Size Used %age\\n'";
|
||||
while($fs = mysql_fetch_array($sql)) {
|
||||
$hostname = gethostbyid($fs['host_id']);
|
||||
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 = str_replace(":","\:",$descr);
|
||||
$rrd = $config['rrd_dir'] . "/$hostname/" . safename("hrStorage-".$fs['hrStorageIndex'].".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";
|
||||
$rrd_options .= " LINE1.25:$fs[storage_id]p#" . $colour . ":'$descr'";
|
||||
$rrd_options .= " GPRINT:$fs[storage_id]s:LAST:%6.2lf%SB";
|
||||
$rrd_options .= " GPRINT:$fs[storage_id]:LAST:%6.2lf%SB";
|
||||
$rrd_options .= " GPRINT:$fs[storage_id]p:LAST:%5.2lf%%\\\\n";
|
||||
$iter++;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -39,7 +39,7 @@ echo('<li class="' . $select['graphs'] . '">
|
||||
</a>
|
||||
</li>');
|
||||
|
||||
$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("
|
||||
#<li class=" . $select['storage'] . ">
|
||||
# <a href='".$config['base_url']."/device/" . $device['device_id'] . '/storage/">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
if(mysql_result(mysql_query("SELECT count(storage_id) FROM storage WHERE host_id = '" . $device['device_id'] . "'"),0)) {
|
||||
if(mysql_result(mysql_query("SELECT count(storage_id) FROM storage WHERE device_id = '" . $device['device_id'] . "'"),0)) {
|
||||
$graph_title = "Storage";
|
||||
$graph_type = "device_hrstorage";
|
||||
include ("includes/print-device-graph.php");
|
||||
|
||||
@@ -1,30 +1,26 @@
|
||||
<?php
|
||||
|
||||
$temp = mysql_result(mysql_query("select count(*) from temperature WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
||||
$storage = mysql_result(mysql_query("select count(*) from storage WHERE host_id = '" . $device['device_id'] . "'"), 0);
|
||||
$cemp = mysql_result(mysql_query("select count(*) from cempMemPool WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
||||
$cmp = mysql_result(mysql_query("select count(*) from cmpMemPool WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
||||
$storage = mysql_result(mysql_query("select count(*) from storage WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
||||
$memory = mysql_result(mysql_query("select count(*) from mempools WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
||||
$processor = mysql_result(mysql_query("select count(*) from processors WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
||||
$fans = mysql_result(mysql_query("select count(*) from fanspeed WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
||||
$volts = mysql_result(mysql_query("select count(*) from voltage WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
||||
|
||||
if ($temp) { $datas[] = 'temp'; }
|
||||
if ($storage) { $datas[] = 'storage'; }
|
||||
if ($cemp) { $datas[] = 'cemp'; }
|
||||
if ($cmp) { $datas[] = 'cmp'; }
|
||||
if ($memory) { $datas[] = 'memory'; }
|
||||
if ($processor) { $datas[] = 'processors'; }
|
||||
if ($fans) { $datas[] = 'fanspeeds'; }
|
||||
if ($volts) { $datas[] = 'voltages'; }
|
||||
|
||||
$type_text['temp'] = "Temperatures";
|
||||
$type_text['cmp'] = "Memory Pools";
|
||||
$type_text['cemp'] = "Memory Enh Pools";
|
||||
$type_text['memory'] = "Memory Pools";
|
||||
$type_text['storage'] = "Disk Usage";
|
||||
$type_text['processors'] = "Processor Usage";
|
||||
$type_text['voltages'] = "Voltages";
|
||||
$type_text['fanspeeds'] = "Fan Speeds";
|
||||
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
unset ($sep);
|
||||
@@ -40,7 +36,7 @@ unset ($sep);
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
if (is_file("pages/device/health/".mres($_GET['opta']).".inc.php")) { include("pages/device/health/".mres($_GET['opta']).".inc.php"); }
|
||||
if (is_file("pages/device/health/".mres($_GET['opta']).".inc.php")) { include("pages/device/health/".mres($_GET['opta']).".inc.php"); } else { echo("failed to open"); }
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
<?php
|
||||
|
||||
echo("<div style='margin-top: 5px; padding: 0px;'>");
|
||||
echo("<table width=100% cellpadding=6 cellspacing=0>");
|
||||
$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('<div class=list-large>".$device['hostname']." - ".$mempool['descr_fixed'];
|
||||
$mempool_popup .= "</div><img src=\'graph.php?id=" . $mempool['cempMemPool_id'] . "&type=cempMemPool&from=$month&to=$now&width=400&height=125\'>";
|
||||
$mempool_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
|
||||
|
||||
|
||||
if($mempool['cpuCPMTotal5minRev'] > '60') { $mempool_colour='#cc0000'; } else { $mempool_colour='#0000cc'; }
|
||||
echo("<tr bgcolor='$row_colour'><td width=350 class=tablehead><a href='' $mempool_popup>" . $mempool['descr_fixed'] ."</a></td>
|
||||
<td><a href='#' $mempool_popup><img src='percentage.php?per=" . $perc . "&width=600'></a></td>
|
||||
<td style='font-weight: bold; color: $drv_colour'>$perc%</td>
|
||||
<td style='color: $drv_colour'>" . formatstorage($mempool['cempMemPoolFree'], 0) . "/" . formatstorage($mempool['cempMemPoolUsed'] + $mempool['cempMemPoolFree'], 0) . "</strong></td>
|
||||
</tr>");
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
$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("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_graph' border=0></a>");
|
||||
echo("</td></tr>");
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,55 +0,0 @@
|
||||
<?php
|
||||
|
||||
echo("<div style='margin-top: 5px; padding: 0px;'>");
|
||||
echo("<table width=100% cellpadding=6 cellspacing=0>");
|
||||
$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('<div class=list-large>".$device['hostname']." - ".$mempool['cmpName'];
|
||||
$mempool_popup .= "</div><img src=\'graph.php?id=" . $mempool['cmp_id'] . "&type=cmpMemPool&from=$month&to=$now&width=400&height=125\'>";
|
||||
$mempool_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
|
||||
|
||||
if($mempool['cpuCPMTotal5minRev'] > '60') { $mempool_colour='#cc0000'; } else { $mempool_colour='#0000cc'; }
|
||||
echo("<tr bgcolor='$row_colour'><td width=350 class=tablehead><a href='' $mempool_popup>" . $mempool['cmpName'] ."</a></td>
|
||||
<td><a href='#' $mempool_popup><img src='percentage.php?per=" . $perc . "&width=600'></a></td>
|
||||
<td style='font-weight: bold; color: $drv_colour'>$perc%</td>
|
||||
<td style='color: $drv_colour'>" . formatstorage($mempool['cmpFree'], 0) . "/" . formatstorage($mempool['cmpUsed'] + $mempool['cmpFree'], 0) . "</strong></td>
|
||||
</tr>");
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
$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("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_graph' border=0></a>");
|
||||
echo("</td></tr>");
|
||||
|
||||
$i++;
|
||||
}
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
echo("<div style='margin-top: 5px; padding: 0px;'>");
|
||||
echo("<table width=100% cellpadding=6 cellspacing=0>");
|
||||
$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('<div class=list-large>".$device['hostname']." - ".$proc['entPhysicalDescr'];
|
||||
$proc_popup .= "</div><img src=\'graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$month&to=$now&width=400&height=125\'>";
|
||||
$proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
|
||||
|
||||
if($proc['cpuCPMTotal5minRev'] > '60') { $proc_colour='#cc0000'; } else { $proc_colour='#0000cc'; }
|
||||
echo("<tr><td class=tablehead width=450><a href='' $proc_popup>" . $proc['hrDeviceDescr'] . "</a></td>
|
||||
<td><a href='#' $proc_popup>
|
||||
<img src='percentage.php?per=" . $proc['hrProcessorLoad'] . "&width=500'></a></td>
|
||||
<td style='font-weight: bold; color: $proc_colour'>" . $proc['hrProcessorLoad'] . "%</td>
|
||||
</tr>");
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
$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("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_graph' border=0></a>");
|
||||
echo("</td></tr>");
|
||||
|
||||
$i++;
|
||||
}
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
|
||||
|
||||
?>
|
||||
@@ -8,16 +8,30 @@
|
||||
|
||||
$proc_url = "?page=device/".$device['device_id']."/health/processors/";
|
||||
|
||||
$proc_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$proc['processor_descr'];
|
||||
$proc_popup .= "</div><img src=\'graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$month&to=$now&width=400&height=125\'>";
|
||||
$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('<div class=list-large>".$device['hostname']." - ".$text_descr;
|
||||
$proc_popup .= "</div><img src=\'graph.php?id=" . $proc['proc_id'] . "&type=proc&from=$month&to=$now&width=400&height=125\'>";
|
||||
$proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
|
||||
|
||||
if($proc['processor_usage'] > '60') { $proc_colour='#cc0000'; } else { $proc_colour='#0000cc'; }
|
||||
echo("<tr><td class=tablehead width=450><a href='' $proc_popup>" . $proc['processor_descr'] . "</a></td>
|
||||
<td><a href='#' $proc_popup>
|
||||
<img src='percentage.php?per=" . $proc['processorLoad'] . "&width=500'></a></td>
|
||||
<td style='font-weight: bold; color: $proc_colour'>" . $proc['processor_usage'] . "%</td>
|
||||
$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("<tr bgcolor=$row_colour><td class=tablehead><a href='".$proc_url."' $proc_popup>" . $text_descr . "</a></td>
|
||||
<td width=90><a href='".$proc_url."' $proc_popup><img src='$mini_url'></a></td>
|
||||
<td width=200><a href='".$proc_url."' $proc_popup>
|
||||
".print_percentage_bar (400, 20, $perc, $perc."%", "ffffff", $left_background, (100 - $perc)."%" , "ffffff", $right_background)."
|
||||
</a></td>
|
||||
</tr>");
|
||||
|
||||
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$sql = "SELECT * FROM `storage` WHERE host_id = '" . $_GET[id] . "' ORDER BY hrStorageDescr";
|
||||
$sql = "SELECT * FROM `storage` WHERE device_id = '" . $_GET[id] . "' ORDER BY storage_descr";
|
||||
$query = mysql_query($sql);
|
||||
|
||||
echo("<table cellspacing=0 cellpadding=5 width=100%>");
|
||||
@@ -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('<div class=list-large>".$device['hostname']." - ".$drive['hrStorageDescr'];
|
||||
$fs_popup .= "</div><img src=\'graph.php?id=" . $drive['storage_id'] . "&type=hrstorage&from=$month&to=$now&width=400&height=125\'>";
|
||||
$fs_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['storage_descr'];
|
||||
$fs_popup .= "</div><img src=\'graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$month&to=$now&width=400&height=125\'>";
|
||||
$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("<tr bgcolor='$row_colour'><th><a href='$fs_url' $fs_popup>" . $drive['hrStorageDescr'] . "</a></td><td>
|
||||
echo("<tr bgcolor='$row_colour'><th><a href='$fs_url' $fs_popup>" . $drive['storage_descr'] . "</a></td><td>
|
||||
<a href='$fs_url' $fs_popup>".print_percentage_bar (400, 20, $perc, "$used / $total", "ffffff", $left_background, $perc . "%", "ffffff", $right_background)."</a>
|
||||
</td><td>" . $free . "</td><td></td></tr>");
|
||||
|
||||
|
||||
$graph_type = "hrstorage";
|
||||
$graph_type = "storage";
|
||||
|
||||
// start temperature graphs
|
||||
|
||||
@@ -61,13 +61,13 @@ while($drive = mysql_fetch_array($query)) {
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=6>");
|
||||
|
||||
echo("<a onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['hrStorageDescr']."</div><img src=\'$daily_url\'>', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\">
|
||||
echo("<a onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['storage_descr']."</div><img src=\'$daily_url\'>', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_temp' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['hrStorageDescr']."</div><img src=\'$weekly_url\'>', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\">
|
||||
echo("<a onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['storage_descr']."</div><img src=\'$weekly_url\'>', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_temp' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['hrStorageDescr']."</div><img src=\'$monthly_url\'>', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\">
|
||||
echo("<a onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['storage_descr']."</div><img src=\'$monthly_url\'>', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_temp' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['hrStorageDescr']."</div><img src=\'$yearly_url\'>', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\">
|
||||
echo("<a onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['storage_descr']."</div><img src=\'$yearly_url\'>', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_temp' border=0></a>");
|
||||
|
||||
echo("</td></tr>");
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
if(mysql_result(mysql_query("SELECT count(*) from hrDevice WHERE device_id = '" . $device['device_id'] . "' AND hrDeviceType = 'hrDeviceProcessor'"),0)) {
|
||||
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p class=sectionhead>Processors</p>");
|
||||
echo("<table width=100%>");
|
||||
$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('<div class=list-large>".$device['hostname']." - ".$proc['entPhysicalDescr'];
|
||||
$proc_popup .= "</div><img src=\'graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$month&to=$now&width=400&height=125\'>";
|
||||
$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("<tr><td class=tablehead width=350><a href='' $proc_popup>" . $text_descr . "</a></td>
|
||||
<td width=220><a href='#' $proc_popup>
|
||||
<img src='percentage.php?per=" . $proc['hrProcessorLoad'] . "&width=200'></a></td>
|
||||
<td style='font-weight: bold; color: $proc_colour'>
|
||||
" . $proc['hrProcessorLoad'] . "%</td>
|
||||
</tr>");
|
||||
$i++;
|
||||
}
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
|
||||
if(mysql_result(mysql_query("SELECT count(storage_id) from storage WHERE host_id = '" . $device['device_id'] . "'"),0)) {
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p class=sectionhead>Storage</p>");
|
||||
echo("<table width=100% cellspacing=0 cellpadding=5>");
|
||||
$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('<div class=list-large>".$device['hostname']." - ".$drive['hrStorageDescr'];
|
||||
$fs_popup .= "</div><img src=\'graph.php?id=" . $drive['storage_id'] . "&type=hrstorage&from=$month&to=$now&width=400&height=125\'>";
|
||||
$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("<tr bgcolor=$row_colour><td class=tablehead><a href='".$fs_url."' $fs_popup>" . $drive['hrStorageDescr'] . "</a></td>
|
||||
<td width=90><a href='".$fs_url."' $fs_popup><img src='$mini_graph' /></a></td>
|
||||
<td width=200><a href='".$fs_url."' $fs_popup>".print_percentage_bar (200, 20, $perc, "$used / $total", "ffffff", $left_background, $perc . "%", "ffffff", $right_background)."</a></td>
|
||||
</tr>");
|
||||
$drive_rows++;
|
||||
}
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
}
|
||||
|
||||
unset ($drive_rows);
|
||||
|
||||
?>
|
||||
@@ -1,85 +0,0 @@
|
||||
<?php
|
||||
|
||||
$sql = "SELECT * FROM `storage` WHERE host_id = '" . $_GET[id] . "' ORDER BY hrStorageDescr";
|
||||
$query = mysql_query($sql);
|
||||
|
||||
echo("<table cellspacing=0 cellpadding=5 width=100%>");
|
||||
|
||||
echo("<tr class=tablehead>
|
||||
<th width=200>Drive</th>
|
||||
<th width=360>Usage</th>
|
||||
<th width=50>Used</th>
|
||||
<th width=50>Total</th>
|
||||
<th width=50>Free</th>
|
||||
<th></th>
|
||||
</tr>");
|
||||
|
||||
$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('<div class=list-large>".$device['hostname']." - ".$drive['hrStorageDescr'];
|
||||
$fs_popup .= "</div><img src=\'graph.php?id=" . $drive['storage_id'] . "&type=unixfs&from=$month&to=$now&width=400&height=125\'>";
|
||||
$fs_popup .= "', RIGHT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"";
|
||||
|
||||
$drv_colour = percent_colour($perc);
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><th><a href='$fs_url' $fs_popup>" . $drive['hrStorageDescr'] . "</a></td><td>
|
||||
<a href='$fs_url' $fs_popup>".print_percentage_bar (200, 16, $perc, "$used / $total", "ffffff", $left_background, $perc . "%", "ffffff", $right_background)."</a>
|
||||
</td><td style='font-weight: bold; color: $drv_colour'>" . $perc . "%</td><td>" . $total . "</td><td>" . $used . "</td><td></td></tr>");
|
||||
|
||||
|
||||
$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("<tr bgcolor='$row_colour'><td colspan=6>");
|
||||
|
||||
echo("<a onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['hrStorageDescr']."</div><img src=\'$daily_url\'>', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_temp' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['hrStorageDescr']."</div><img src=\'$weekly_url\'>', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_temp' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['hrStorageDescr']."</div><img src=\'$monthly_url\'>', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_temp' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$drive['hrStorageDescr']."</div><img src=\'$yearly_url\'>', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_temp' border=0></a>");
|
||||
|
||||
echo("</td></tr>");
|
||||
|
||||
|
||||
$row++;
|
||||
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
|
||||
|
||||
?>
|
||||
+22
-17
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
if($_SESSION['userlevel'] >= '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("<div style='padding: 5px;'>
|
||||
<table width=100% cellspacing=0 cellpadding=2>");
|
||||
|
||||
echo("<tr class=tablehead>
|
||||
<th width=280>Device</th>
|
||||
<th>Storage</th>
|
||||
<th width=420>Usage</th>
|
||||
<th width=100>Free</th>
|
||||
</tr>");
|
||||
#echo("<tr class=tablehead>
|
||||
# <th width=280>Device</th>
|
||||
# <th>Storage</th>
|
||||
# <th width=100></th>
|
||||
# <th width=280>Usage</th>
|
||||
# <th width=100>Used</th>
|
||||
# </tr>");
|
||||
|
||||
$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('<img src=\'$store_url\'>', 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("<tr bgcolor='$row_colour'><td>" . generatedevicelink($drive) . "</td><td class=tablehead>" . $drive['hrStorageDescr'] . "</td><td>
|
||||
<a href='#' $store_popup>".print_percentage_bar (400, 20, $perc, "$used / $total", "ffffff", $left_background, $perc . "%", "ffffff", $right_background)."</a>
|
||||
</td><td>" . formatStorage($free) . "</td></tr>");
|
||||
echo("<tr bgcolor='$row_colour'><td>" . generatedevicelink($drive) . "</td><td class=tablehead>" . $drive['storage_descr'] . "</td>
|
||||
<td><img src='$mini_graph'></td>
|
||||
<td>
|
||||
<a href='#' $store_popup>".print_percentage_bar (400, 20, $perc, "$used / $total", "ffffff", $left_background, formatStorage($free), "ffffff", $right_background)."</a>
|
||||
</td><td>$perc"."%</td></tr>");
|
||||
|
||||
|
||||
$row++;
|
||||
|
||||
Reference in New Issue
Block a user