Files

101 lines
2.7 KiB
PHP
Raw Permalink Normal View History

2012-01-12 11:09:45 +00:00
<?php
print_optionbar_start();
2015-07-13 20:10:26 +02:00
echo "<span style='font-weight: bold;'>Serverfarms</span> &#187; ";
2012-01-12 11:09:45 +00:00
2015-07-13 20:10:26 +02:00
// $auth = TRUE;
$menu_options = array('basic' => 'Basic');
2012-01-12 11:09:45 +00:00
2015-07-13 20:10:26 +02:00
if (!$_GET['opta']) {
$_GET['opta'] = 'basic';
}
$sep = '';
foreach ($menu_options as $option => $text) {
if ($_GET['type'] == $option) {
echo "<span class='pagemenu-selected'>";
}
2012-01-12 11:09:45 +00:00
2015-07-13 20:10:26 +02:00
echo '<a href="'.generate_url($vars, array('type' => $option)).'">'.$text.'</a>';
if ($_GET['type'] == $option) {
echo '</span>';
}
2012-01-12 11:09:45 +00:00
2015-07-13 20:10:26 +02:00
echo ' | ';
2012-01-12 11:09:45 +00:00
}
unset($sep);
2015-07-13 20:10:26 +02:00
echo ' Graphs: ';
2012-01-12 11:09:45 +00:00
2015-07-13 20:10:26 +02:00
$graph_types = array(
'bits' => 'Bits',
'pkts' => 'Packets',
'conns' => 'Connections',
);
2012-01-12 11:09:45 +00:00
2015-07-13 20:10:26 +02:00
foreach ($graph_types as $type => $descr) {
echo "$type_sep";
if ($_GET['opte'] == $type) {
echo "<span class='pagemenu-selected'>";
}
2012-01-12 11:09:45 +00:00
2015-07-13 20:10:26 +02:00
echo '<a href="device/device='.$device['device_id'].'/tab=routing/type=loadbalancer_vservers/graphs/'.$type.'/">'.$descr.'</a>';
echo '<a href="'.generate_url($vars, array('type' => 'loadbalancer_ace_vservers')).'">'.$text.'</a>';
if ($_GET['opte'] == $type) {
echo '</span>';
}
2012-01-12 11:09:45 +00:00
2015-07-13 20:10:26 +02:00
$type_sep = ' | ';
2012-01-12 11:09:45 +00:00
}
2015-07-13 20:10:26 +02:00
print_optionbar_end();
2012-01-12 11:09:45 +00:00
2015-07-13 20:10:26 +02:00
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)) {
2019-06-23 00:29:12 -05:00
$bg_colour = \LibreNMS\Config::get('list_colour.even');
2016-08-18 20:28:22 -05:00
} else {
2019-06-23 00:29:12 -05:00
$bg_colour = \LibreNMS\Config::get('list_colour.odd');
2015-07-13 20:10:26 +02:00
}
if ($vserver['serverstate'] == 'inService') {
$vserver_class = 'green';
2016-08-18 20:28:22 -05:00
} else {
2015-07-13 20:10:26 +02:00
$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['type'] == 'graphs') {
echo '<tr class="list-bold">';
echo '<td colspan = 3>';
$graph_type = 'vserver_'.$_GET['opte'];
$graph_array['height'] = '100';
$graph_array['width'] = '215';
2019-06-23 00:29:12 -05:00
$graph_array['to'] = \LibreNMS\Config::get('time.now');
2015-07-13 20:10:26 +02:00
$graph_array['id'] = $vserver['classmap_id'];
$graph_array['type'] = $graph_type;
2019-04-11 23:26:42 -05:00
include 'includes/html/print-graphrow.inc.php';
2015-07-13 20:10:26 +02:00
echo '
</td>
</tr>';
}
echo '</td>';
echo '</tr>';
$i++;
}//end foreach
echo '</table></div>';