Cisco ACE support thanks to wez_db

git-svn-id: http://www.observium.org/svn/observer/trunk@2814 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-01-12 11:09:45 +00:00
parent 7a8b14766a
commit b15ac997f8
22 changed files with 15929 additions and 3 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
if (is_numeric($id))
{
# $auth= TRUE;
$rserver = dbFetchRow("SELECT * FROM `loadbalancer_rservers` AS I, `devices` AS D WHERE I.rserver_id = ? AND I.device_id = D.device_id", array($id));
if (is_numeric($rserver['device_id']) && ($config['allow_unauth_graphs'] || device_permitted($rserver['device_id'])))
{
$device = device_by_id_cache($rserver['device_id']);
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("rserver-".$rserver['rserver_id'].".rrd");
$title = generate_device_link($device);
$title .= " :: Rserver :: " . htmlentities($rserver['farm_id']);
$auth = TRUE;
}
}
?>
+40
View File
@@ -0,0 +1,40 @@
<?php
##$ds_in = "RserverCurrentConns";
##$ds_out = "RserverTotalConns";
##include("includes/graphs/generic_bytes.inc.php");
#$ds = "RserverCurrentConns";
#$colour_area = "B0C4DE";
#$colour_line = "191970";
#$colour_area_max = "FFEE99";
#$graph_max = 1;
#$unit_text = "Conns";
#include("includes/graphs/generic_simplex.inc.php");
$scale_min = 0;
include("includes/graphs/common.inc.php");
$graph_max = 1;
$ds = "RserverCurrentConns";
$colour_area = "B0C4DE";
$colour_line = "191970";
$colour_area_max = "FFEE99";
$nototal = 1;
$unit_text = "Conns";
include("includes/graphs/generic_simplex.inc.php");
?>
+21
View File
@@ -0,0 +1,21 @@
<?php
$scale_min = 0;
include("includes/graphs/common.inc.php");
$graph_max = 1;
$ds = "RserverCurrentConns";
$colour_area = "B0C4DE";
$colour_line = "191970";
$colour_area_max = "FFEE99";
$nototal = 1;
$unit_text = "Conns";
include("includes/graphs/generic_simplex.inc.php");
?>
+21
View File
@@ -0,0 +1,21 @@
<?php
$scale_min = 0;
include("includes/graphs/common.inc.php");
$graph_max = 1;
$ds = "RserverTotalConns";
$colour_area = "B0C4DE";
$colour_line = "191970";
$colour_area_max = "FFEE99";
$nototal = 1;
$unit_text = "Conns";
include("includes/graphs/generic_simplex.inc.php");
?>
+20
View File
@@ -0,0 +1,20 @@
<?php
if (is_numeric($id))
{
# $auth= TRUE;
$vserver = dbFetchRow("SELECT * FROM `loadbalancer_vservers` AS I, `devices` AS D WHERE I.classmap_id = ? AND I.device_id = D.device_id", array($id));
if (is_numeric($vserver['device_id']) && ($config['allow_unauth_graphs'] || device_permitted($vserver['device_id'])))
{
$device = device_by_id_cache($vserver['device_id']);
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("vserver-".$vserver['classmap_id'].".rrd");
$title = generate_device_link($device);
$title .= " :: Serverfarm :: " . htmlentities($vserver['classmap_id']);
$auth = TRUE;
}
}
?>
+12
View File
@@ -0,0 +1,12 @@
<?php
#include("includes/graphs/common.inc.php");
$ds_in = "ByteCounts";
$ds_out = "ClientByteCounts";
include("includes/graphs/generic_bytes.inc.php");
#include("includes/graphs/generic_duplex.inc.php");
?>
+21
View File
@@ -0,0 +1,21 @@
<?php
$scale_min = 0;
include("includes/graphs/common.inc.php");
$graph_max = 1;
$ds = "NumberOfConnections";
$colour_area = "B0C4DE";
$colour_line = "191970";
$colour_area_max = "FFEE99";
$nototal = 1;
$unit_text = "Conns";
include("includes/graphs/generic_simplex.inc.php");
?>
+18
View File
@@ -0,0 +1,18 @@
<?php
$ds_in = "PacketCounts";
$ds_out = "ClientPacketCounts";
$colour_area_in = "AA66AA";
$colour_line_in = "330033";
$colour_area_out = "FFDD88";
$colour_line_out = "FF6600";
$colour_area_in_max = "cc88cc";
$colour_area_out_max = "FFefaa";
$graph_max = 1;
$unit_text = "Packets";
include("includes/graphs/generic_duplex.inc.php");
?>
+6
View File
@@ -155,6 +155,12 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
### $routing_tabs is used in device/routing/ to build the tabs menu. we built it here to save some queries
$device_routing_count['loadbalancer_vservers'] = dbFetchCell("SELECT COUNT(*) FROM `loadbalancer_vservers` WHERE `device_id` = ?", array($device['device_id']));
if ($device_routing_count['loadbalancer_vservers']) { $routing_tabs[] = 'loadbalancer_vservers'; }
$device_routing_count['loadbalancer_rservers'] = dbFetchCell("SELECT COUNT(*) FROM `loadbalancer_rservers` WHERE `device_id` = ?", array($device['device_id']));
if ($device_routing_count['loadbalancer_rservers']) { $routing_tabs[] = 'loadbalancer_rservers'; }
$device_routing_count['ipsec_tunnels'] = dbFetchCell("SELECT COUNT(*) FROM `ipsec_tunnels` WHERE `device_id` = ?", array($device['device_id']));
if ($device_routing_count['ipsec_tunnels']) { $routing_tabs[] = 'ipsec_tunnels'; }
+2
View File
@@ -6,6 +6,8 @@ $link_array = array('page' => 'device',
#$type_text['overview'] = "Overview";
$type_text['ipsec_tunnels'] = "IPSEC Tunnels";
$type_text['loadbalancer_rservers'] = "Rservers";
$type_text['loadbalancer_vservers'] = "Serverfarms";
$type_text['bgp'] = "BGP";
$type_text['cef'] = "CEF";
$type_text['ospf'] = "OSPF";
@@ -0,0 +1,90 @@
<?php
print_optionbar_start();
echo("<span style='font-weight: bold;'>Serverfarm Rservers</span> &#187; ");
#$auth = TRUE;
$menu_options = array('basic' => 'Basic',
);
if (!$_GET['opta']) { $_GET['opta'] = "basic"; }
$sep = "";
foreach ($menu_options as $option => $text)
{
if ($_GET['optd'] == $option) { echo("<span class='pagemenu-selected'>"); }
echo('<a href="device/device=' . $device['device_id'] . '/tab=routing/proto=loadbalancer_rservers/' . $option . '/">' . $text
. '</a>');
if ($_GET['optd'] == $option) { echo("</span>"); }
echo(" | ");
}
unset($sep);
echo(' Graphs: ');
#$graph_types = array("bits" => "Bits",
# "pkts" => "Packets",
# "errors" => "Errors");
$graph_types = array("curr" => "CurrentConns",
"failed" => "FailedConns",
"total" => "TotalConns");
foreach ($graph_types as $type => $descr)
{
echo("$type_sep");
if ($_GET['opte'] == $type) { echo("<span class='pagemenu-selected'>"); }
echo('<a href="device/device=' . $device['device_id'] . '/tab=routing/proto=loadbalancer_rservers/graphs/'.$type.'/">'.$descr.'</a>');
if ($_GET['opte'] == $type) { echo("</span>"); }
$type_sep = " | ";
}
print_optionbar_end();
echo("<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=0 width=100%>");
$i = "0";
foreach (dbFetchRows("SELECT * FROM `loadbalancer_rservers` WHERE `device_id` = ? ORDER BY `farm_id`", array($device['device_id'])) as $rserver)
{
if (is_integer($i/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; }
if($rserver['StateDescr'] == "Server is now operational") { $rserver_class="green"; } else { $rserver_class="red"; }
echo("<tr bgcolor='$bg_colour'>");
#echo("<td width=320 class=list-large>" . $tunnel['local_addr'] . " &#187; " . $tunnel['peer_addr'] . "</a></td>");
echo("<td width=700 class=list-small>" . $rserver['farm_id'] . "</a></td>");
#echo("<td width=150 class=box-desc>" . $rserver['farm_id'] . "</td>");
echo("<td width=230 class=list-small><span class='".$rserver_class."'>" . $rserver['StateDescr'] . "</span></td>");
echo("</tr>");
if ($_GET['optd'] == "graphs")
{
echo('<tr class="list-bold">');
echo("<td colspan = 3>");
$graph_type = "rserver_" . $_GET['opte'];
$graph_array['height'] = "100";
$graph_array['width'] = "215";
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $rserver['rserver_id'];
$graph_array['type'] = $graph_type;
include("includes/print-quadgraphs.inc.php");
#include("includes/print-interface-graphs.inc.php");
echo("
</td>
</tr>");
}
echo("</td>");
echo("</tr>");
$i++;
}
echo("</table></div>");
?>
@@ -0,0 +1,86 @@
<?php
print_optionbar_start();
echo("<span style='font-weight: bold;'>Serverfarms</span> &#187; ");
#$auth = TRUE;
$menu_options = array('basic' => 'Basic',
);
if (!$_GET['opta']) { $_GET['opta'] = "basic"; }
$sep = "";
foreach ($menu_options as $option => $text)
{
if ($_GET['optd'] == $option) { echo("<span class='pagemenu-selected'>"); }
echo('<a href="device/device=' . $device['device_id'] . '/tab=routing/proto=loadbalancer_vservers/' . $option . '/">' . $text
. '</a>');
if ($_GET['optd'] == $option) { echo("</span>"); }
echo(" | ");
}
unset($sep);
echo(' Graphs: ');
$graph_types = array("bits" => "Bits",
"pkts" => "Packets",
"conns" => "Connections");
foreach ($graph_types as $type => $descr)
{
echo("$type_sep");
if ($_GET['opte'] == $type) { echo("<span class='pagemenu-selected'>"); }
echo('<a href="device/device=' . $device['device_id'] . '/tab=routing/proto=loadbalancer_vservers/graphs/'.$type.'/">'.$descr.'</a>');
if ($_GET['opte'] == $type) { echo("</span>"); }
$type_sep = " | ";
}
print_optionbar_end();
echo("<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=0 width=100%>");
$i = "0";
foreach (dbFetchRows("SELECT * FROM `loadbalancer_vservers` WHERE `device_id` = ? ORDER BY `classmap`", array($device['device_id'])) as $vserver)
{
if (is_integer($i/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; }
if($vserver['serverstate'] == "inService") { $vserver_class="green"; } else { $vserver_class="red"; }
echo("<tr bgcolor='$bg_colour'>");
#echo("<td width=320 class=list-large>" . $tunnel['local_addr'] . " &#187; " . $tunnel['peer_addr'] . "</a></td>");
echo("<td width=700 class=list-small>" . $vserver['classmap'] . "</a></td>");
#echo("<td width=150 class=box-desc>" . $rserver['farm_id'] . "</td>");
echo("<td width=230 class=list-small><span class='".$vserver_class."'>" . $vserver['serverstate'] . "</span></td>");
echo("</tr>");
if ($_GET['optd'] == "graphs")
{
echo('<tr class="list-bold">');
echo("<td colspan = 3>");
$graph_type = "vserver_" . $_GET['opte'];
$graph_array['height'] = "100";
$graph_array['width'] = "215";
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $vserver['classmap_id'];
$graph_array['type'] = $graph_type;
include("includes/print-quadgraphs.inc.php");
echo("
</td>
</tr>");
}
echo("</td>");
echo("</tr>");
$i++;
}
echo("</table></div>");
?>