mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
split netscaler and cisco ace stats to new load balancer tab (it's not routing :P)
git-svn-id: http://www.observium.org/svn/observer/trunk@2828 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -153,20 +153,31 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
|
||||
</li>');
|
||||
}
|
||||
|
||||
### $routing_tabs is used in device/routing/ to build the tabs menu. we built it here to save some queries
|
||||
### $loadbalancer_tabs is used in device/loadbalancer/ to build the submenu. we do it here to save queries
|
||||
|
||||
if($device['os'] == "netscaler") /// Netscaler
|
||||
{
|
||||
$device_routing_count['netscaler_vsvr'] = dbFetchCell("SELECT COUNT(*) FROM `netscaler_vservers` WHERE `device_id` = ?", array($device['device_id']));
|
||||
if ($device_routing_count['netscaler_vsvr']) { $routing_tabs[] = 'netscaler_vsvr'; }
|
||||
$device_loadbalancer_count['netscaler_vsvr'] = dbFetchCell("SELECT COUNT(*) FROM `netscaler_vservers` WHERE `device_id` = ?", array($device['device_id']));
|
||||
if ($device_loadbalancer_count['netscaler_vsvr']) { $loadbalancer_tabs[] = 'netscaler_vsvr'; }
|
||||
}
|
||||
|
||||
if($device['os'] == "acsw") /// Cisco ACE
|
||||
{
|
||||
$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_loadbalancer_count['loadbalancer_vservers'] = dbFetchCell("SELECT COUNT(*) FROM `loadbalancer_vservers` WHERE `device_id` = ?", array($device['device_id']));
|
||||
if ($device_loadbalancer_count['loadbalancer_vservers']) { $loadbalancer_tabs[] = 'loadbalancer_vservers'; }
|
||||
}
|
||||
|
||||
if (is_array($loadbalancer_tabs))
|
||||
{
|
||||
echo('<li class="' . $select['loadbalancer'] . '">
|
||||
<a href="'.generate_device_url($device, array('tab' => 'loadbalancer')).'">
|
||||
<img src="images/16/arrow_divide.png" align="absmiddle" border="0" /> Load Balancer
|
||||
</a>
|
||||
</li>');
|
||||
}
|
||||
|
||||
### $routing_tabs is used in device/routing/ to build the tabs menu. we built it here to save some queries
|
||||
|
||||
$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'; }
|
||||
|
||||
|
||||
67
html/pages/device/loadbalancer.inc.php
Normal file
67
html/pages/device/loadbalancer.inc.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
$link_array = array('page' => 'device',
|
||||
'device' => $device['device_id'],
|
||||
'tab' => 'loadbalancer');
|
||||
|
||||
## Cisco ACE
|
||||
$type_text['loadbalancer_rservers'] = "Rservers";
|
||||
$type_text['loadbalancer_vservers'] = "Serverfarms";
|
||||
|
||||
## Citrix Netscaler
|
||||
$type_text['netscaler_vsvr'] = "VServers";
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
$pagetitle[] = "Load Balancer";
|
||||
|
||||
echo("<span style='font-weight: bold;'>Load Balancer</span> » ");
|
||||
|
||||
unset($sep);
|
||||
foreach ($loadbalancer_tabs as $type)
|
||||
{
|
||||
|
||||
if (!$vars['proto']) { $vars['proto'] = $type; }
|
||||
|
||||
echo($sep);
|
||||
|
||||
if ($vars['proto'] == $type)
|
||||
{
|
||||
echo('<span class="pagemenu-selected">');
|
||||
}
|
||||
|
||||
echo(generate_link($type_text[$type] ." (".$device_loadbalancer_count[$type].")",$link_array,array('proto'=>$type)));
|
||||
if ($vars['proto'] == $type) { echo("</span>"); }
|
||||
$sep = " | ";
|
||||
}
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
if (is_file("pages/device/loadbalancer/".mres($vars['proto']).".inc.php"))
|
||||
{
|
||||
include("pages/device/loadbalancer/".mres($vars['proto']).".inc.php");
|
||||
} else {
|
||||
foreach ($loadbalancer_tabs as $type)
|
||||
{
|
||||
if ($type != "overview")
|
||||
{
|
||||
if (is_file("pages/device/loadbalancer/overview/".mres($type).".inc.php")) {
|
||||
|
||||
$g_i++;
|
||||
if (!is_integer($g_i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
echo('<div style="background-color: '.$row_colour.';">');
|
||||
echo('<div style="padding:4px 0px 0px 8px;"><span class=graphhead>'.$type_text[$type].'</span>');
|
||||
include("pages/device/loadbalancer/overview/".mres($type).".inc.php");
|
||||
echo('</div>');
|
||||
echo('</div>');
|
||||
} else {
|
||||
$graph_title = $type_text[$type];
|
||||
$graph_type = "device_".$type;
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
echo("<span style='font-weight: bold;'>Serverfarms</span> » ");
|
||||
echo("<span style='font-weight: bold;'>VServers</span> » ");
|
||||
|
||||
#$auth = TRUE;
|
||||
|
||||
Reference in New Issue
Block a user