From 98fb1ef6f8c08fd57dd27f2918cdf790d46cce8a Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Fri, 23 Apr 2010 13:11:14 +0000 Subject: [PATCH] Juniper ATM VP graphing (basic, dirty) for thevoke git-svn-id: http://www.observium.org/svn/observer/trunk@1070 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/graphs/atmvp_bits.inc.php | 22 ++++++++ html/includes/graphs/atmvp_cells.inc.php | 33 ++++++++++++ html/includes/graphs/atmvp_errors.inc.php | 34 ++++++++++++ html/includes/graphs/atmvp_packets.inc.php | 33 ++++++++++++ html/pages/device/interface.inc.php | 2 +- html/pages/device/port/junose-atm-vp.inc.php | 56 +++++--------------- 6 files changed, 136 insertions(+), 44 deletions(-) create mode 100644 html/includes/graphs/atmvp_bits.inc.php create mode 100644 html/includes/graphs/atmvp_cells.inc.php create mode 100644 html/includes/graphs/atmvp_errors.inc.php create mode 100644 html/includes/graphs/atmvp_packets.inc.php diff --git a/html/includes/graphs/atmvp_bits.inc.php b/html/includes/graphs/atmvp_bits.inc.php new file mode 100644 index 0000000000..4000cccc4a --- /dev/null +++ b/html/includes/graphs/atmvp_bits.inc.php @@ -0,0 +1,22 @@ + diff --git a/html/includes/graphs/atmvp_cells.inc.php b/html/includes/graphs/atmvp_cells.inc.php new file mode 100644 index 0000000000..88966210ed --- /dev/null +++ b/html/includes/graphs/atmvp_cells.inc.php @@ -0,0 +1,33 @@ + diff --git a/html/includes/graphs/atmvp_errors.inc.php b/html/includes/graphs/atmvp_errors.inc.php new file mode 100644 index 0000000000..ca72fe05b2 --- /dev/null +++ b/html/includes/graphs/atmvp_errors.inc.php @@ -0,0 +1,34 @@ + diff --git a/html/includes/graphs/atmvp_packets.inc.php b/html/includes/graphs/atmvp_packets.inc.php new file mode 100644 index 0000000000..d67f55daa4 --- /dev/null +++ b/html/includes/graphs/atmvp_packets.inc.php @@ -0,0 +1,33 @@ + diff --git a/html/pages/device/interface.inc.php b/html/pages/device/interface.inc.php index 5f0a8032dd..ce6bd685b6 100644 --- a/html/pages/device/interface.inc.php +++ b/html/pages/device/interface.inc.php @@ -68,7 +68,7 @@ echo (" "0"){ echo(" | ATM VPs :"); - echo(" Bits"); + echo(" Bits"); echo(" | Packets"); echo(" | Cells"); echo(" | Errors"); diff --git a/html/pages/device/port/junose-atm-vp.inc.php b/html/pages/device/port/junose-atm-vp.inc.php index e261aa70db..ac1076ea2d 100644 --- a/html/pages/device/port/junose-atm-vp.inc.php +++ b/html/pages/device/port/junose-atm-vp.inc.php @@ -1,19 +1,7 @@ "; - -} - + if($_GET['optc']) { $graph_type = "atmvp_".$_GET['optc']; } + if(!$graph_type) { $graph_type = "atmvp_bits"; } echo(""); @@ -23,39 +11,21 @@ function print_graph ($args) { echo(''); echo(''); - $graph_array['height'] = "150"; - $graph_array['width'] = "150"; + $graph_array['height'] = "100"; + $graph_array['width'] = "215"; $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("', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"> - "); - echo("', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"> - "); - echo("', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\"> - "); - echo("', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\"> - "); + $graph_array['type'] = $graph_type; + $periods = array('day', 'week', 'month', 'year'); + echo(""); }
VP'.$vp['vp_id'].' '.$vp['vp_descr'].'
"); + foreach($periods as $period) { + $graph_array['from'] = $$period; + $graph_array_zoom = $graph_array; $graph_array_zoom['height'] = "150"; $graph_array_zoom['width'] = "400"; + echo(overlib_link($_SERVER['REQUEST_URI'], generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL)); + } + echo("