git-svn-id: http://www.observium.org/svn/observer/trunk@428 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-05-11 13:43:59 +00:00
parent cf1e2830cf
commit 67fc89c6e7
22 changed files with 395 additions and 106 deletions
+62
View File
@@ -0,0 +1,62 @@
<?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>");
?>
+52
View File
@@ -0,0 +1,52 @@
<?php
echo("<div style='margin-top: 5px; padding: 0px;'>");
echo("<table width=100% cellpadding=6 cellspacing=0>");
$i = '1';
$procs = mysql_query("SELECT * FROM `cpmCPU` WHERE device_id = '" . $device['device_id'] . "'");
while($proc = mysql_fetch_array($procs)) {
$proc_url = "?page=device/".$device['device_id']."/health/cpm/";
$proc_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$proc['entPhysicalDescr'];
$proc_popup .= "</div><img src=\'graph.php?id=" . $proc['cpmCPU_id'] . "&type=cpmCPU&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=350><a href='' $proc_popup>" . $proc['entPhysicalDescr'] . "</a></td>
<td><a href='#' $proc_popup><img src='percentage.php?per=" . $proc['cpmCPUTotal5minRev'] . "&width=600'></a></td>
<td style='font-weight: bold; color: $drv_colour'>" . $proc['cpmCPUTotal5minRev'] . "%</td>
</tr>");
echo("<tr bgcolor='$row_colour'><td colspan=5>");
$daily_graph = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cempMemPool&from=$day&to=$now&width=211&height=100";
$daily_url = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cempMemPool&from=$day&to=$now&width=400&height=150";
$weekly_graph = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cempMemPool&from=$week&to=$now&width=211&height=100";
$weekly_url = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cempMemPool&from=$week&to=$now&width=400&height=150";
$monthly_graph = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cempMemPool&from=$month&to=$now&width=211&height=100";
$monthly_url = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cempMemPool&from=$month&to=$now&width=400&height=150";
$yearly_graph = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cempMemPool&from=$year&to=$now&width=211&height=100";
$yearly_url = "graph.php?id=" . $proc['cpmCPU_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>");
?>
+59
View File
@@ -0,0 +1,59 @@
<?php
$sql = "SELECT * FROM `temperature` WHERE temp_host = '" . $_GET[id] . "' ORDER BY temp_descr";
$query = mysql_query($sql);
echo("<table cellspacing=0 cellpadding=5 width=100%>");
$row = 1;
while($temp = mysql_fetch_array($query)) {
if(!is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
echo("<tr class=list-large style=\"background-color: $row_colour; padding: 5px;\">
<td width=350>" . $temp['temp_descr'] . "</td>
<td>" . print_temperature($temp['temp_current'], $temp['temp_limit']) . "</td>
<td>" . $temp['temp_limit'] . "</td>
<td>" . $temp['temp_notes'] . "</td>
</tr>\n");
echo("<tr bgcolor=$row_colour><td colspan='4'>");
$graph_type = "temp";
// start temperature graphs
$daily_temp = "graph.php?id=" . $temp['temp_id'] . "&type=$graph_type&from=$day&to=$now&width=211&height=100";
$daily_url = "graph.php?id=" . $temp['temp_id'] . "&type=$graph_type&from=$day&to=$now&width=400&height=150";
$weekly_temp = "graph.php?id=" . $temp['temp_id'] . "&type=$graph_type&from=$week&to=$now&width=211&height=100";
$weekly_url = "graph.php?id=" . $temp['temp_id'] . "&type=$graph_type&from=$week&to=$now&width=400&height=150";
$monthly_temp = "graph.php?id=" . $temp['temp_id'] . "&type=$graph_type&from=$month&to=$now&width=211&height=100";
$monthly_url = "graph.php?id=" . $temp['temp_id'] . "&type=$graph_type&from=$month&to=$now&width=400&height=150";
$yearly_temp = "graph.php?id=" . $temp['temp_id'] . "&type=$graph_type&from=$year&to=$now&width=211&height=100";
$yearly_url = "graph.php?id=" . $temp['temp_id'] . "&type=$graph_type&from=$year&to=$now&width=400&height=150";
echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$daily_temp' border=0></a> ");
echo("<a onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$weekly_temp' border=0></a> ");
echo("<a onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$monthly_temp' border=0></a> ");
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$yearly_temp' border=0></a>");
echo("</td></tr>");
$row++;
}
echo("</table>");
?>