add some files i never knew we needed

git-svn-id: http://www.observium.org/svn/observer/trunk@1028 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-03-14 15:21:55 +00:00
parent a3495b015c
commit 662a5d0acb
2 changed files with 94 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?php
if(file_exists($config['rrd_dir'] . "/" . $hostname . "/". $ifIndex . ".rrd")) {
$iid = $id;
echo("<div class=graphhead>Interface Traffic</div>");
$graph_type = "port_bits";
include("includes/print-interface-graphs.inc.php");
echo("<div class=graphhead>Interface Packets</div>");
$graph_type = "port_upkts";
include("includes/print-interface-graphs.inc.php");
echo("<div class=graphhead>Interface Non Unicast</div>");
$graph_type = "port_nupkts";
include("includes/print-interface-graphs.inc.php");
echo("<div class=graphhead>Interface Errors</div>");
$graph_type = "port_errors";
include("includes/print-interface-graphs.inc.php");
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] . "/etherlike-" . $interface['ifIndex'] . ".rrd")) {
echo("<div class=graphhead>Ethernet Errors</div>");
$graph_type = "port_etherlike";
include("includes/print-interface-graphs.inc.php");
}
}
?>

View File

@@ -0,0 +1,64 @@
<?php
function print_graph ($args) {
global $config;
$sep = "?";
$url = $config['base_url'] . "/graph.php";
foreach ($args as $arg) {
$url .= $sep.$arg;
}
return "<img src=\"".$url."\" border=0>";
}
echo("<table cellspacing=0 cellpadding=5 border=0>");
$vps = mysql_query("SELECT * FROM juniAtmVp WHERE interface_id = '".$interface['interface_id']."'");
while($vp = mysql_fetch_array($vps)) {
echo('<tr>');
echo('<td>VP'.$vp['vp_id'].' '.$vp['vp_descr'].'</td>');
echo('</tr>');
$graph_array['height'] = "150";
$graph_array['width'] = "150";
$graph_array['to'] = $now;
$graph_array['id'] = $vp['juniAtmVp_id'];
$graph_array['type'] = "juniAtmVp_".$_GET['optc'];
if(!$graph_type) { $graph_type = "pagp_bits"; }
$daily_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$day&to=$now&width=215&height=100";
$daily_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$day&to=$now&width=500&height=150";
$weekly_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$week&to=$now&width=215&height=100";
$weekly_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$week&to=$now&width=500&height=150";
$monthly_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$month&to=$now&width=215&height=100";
$monthly_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$month&to=$now&width=500&height=150";
$yearly_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$year&to=$now&width=215&height=100";
$yearly_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$year&to=$now&width=500&height=150";
echo("<a href='/device/".$device['device_id']."/interface/".$interface['interface_id']."/' onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
<img src='$daily_traffic' border=0></a> ");
echo("<a href='/device/".$device['device_id']."/interface/".$interface['interface_id']."/' onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
<img src='$weekly_traffic' border=0></a> ");
echo("<a href='/device/".$device['device_id']."/interface/".$interface['interface_id']."/' onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
<img src='$monthly_traffic' border=0></a> ");
echo("<a href='/device/".$device['device_id']."/interface/".$interface['interface_id']."/' onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
<img src='$yearly_traffic' border=0></a>");
}
echo("</table>");
?>