VServer » ");
// echo('All');
// print_optionbar_end();
$graph_types = array(
'bits' => 'Bits',
'pkts' => 'Packets',
'conns' => 'Connections',
'reqs' => 'Requests',
'hitmiss' => 'Hit/Miss',
);
$i = 0;
echo "
";
foreach (dbFetchRows('SELECT * FROM `netscaler_vservers` WHERE `device_id` = ? AND `vsvr_id` = ? ORDER BY `vsvr_name`', array($device['device_id'], $vars['vsvr'])) as $vsvr) {
if (is_integer($i / 2)) {
$bg_colour = $list_colour_a;
}
else {
$bg_colour = $list_colour_b;
}
if ($vsvr['vsvr_state'] == 'up') {
$vsvr_class = 'green';
}
else {
$vsvr_class = 'red';
}
echo "";
echo ''.$vsvr['vsvr_name'].' | ';
echo ''.$vsvr['vsvr_ip'].':'.$vsvr['vsvr_port'].' | ';
echo "".$vsvr['vsvr_state'].' | ';
echo (''.format_si(($vsvr['vsvr_bps_in'] * 8)).'bps | ');
echo (''.format_si(($vsvr['vsvr_bps_out'] * 8)).'bps | ');
echo '
';
foreach ($graph_types as $graph_type => $graph_text) {
$i++;
echo '';
echo '';
$graph_type = 'netscalervsvr_'.$graph_type;
$graph_array['height'] = '100';
$graph_array['width'] = '213';
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $vsvr['vsvr_id'];
$graph_array['type'] = $graph_type;
echo ''.$graph_text.'';
include 'includes/print-graphrow.inc.php';
echo '
|
';
}
}//end foreach
echo '
';
}
else {
print_optionbar_start();
echo "VServers » ";
$menu_options = array('basic' => 'Basic');
if (!$vars['view']) {
$vars['view'] = 'basic';
}
$sep = '';
foreach ($menu_options as $option => $text) {
if ($vars['view'] == $option) {
echo "';
}
echo ' | ';
}
unset($sep);
echo ' Graphs: ';
$graph_types = array(
'bits' => 'Bits',
'pkts' => 'Packets',
'conns' => 'Connections',
'reqs' => 'Requests',
'hitmiss' => 'Hit/Miss',
);
foreach ($graph_types as $type => $descr) {
echo "$type_sep";
if ($vars['graph'] == $type) {
echo "';
}
$type_sep = ' | ';
}
print_optionbar_end();
echo "";
$i = '0';
foreach (dbFetchRows('SELECT * FROM `netscaler_vservers` WHERE `device_id` = ? ORDER BY `vsvr_name`', array($device['device_id'])) as $vsvr) {
if (is_integer($i / 2)) {
$bg_colour = $list_colour_a;
}
else {
$bg_colour = $list_colour_b;
}
if ($vsvr['vsvr_state'] == 'up') {
$vsvr_class = 'green';
}
else {
$vsvr_class = 'red';
}
echo "";
echo ''.$vsvr['vsvr_name'].' | ';
echo ''.$vsvr['vsvr_ip'].':'.$vsvr['vsvr_port'].' | ';
echo "".$vsvr['vsvr_state'].' | ';
echo (''.format_si(($vsvr['vsvr_bps_in'] * 8)).'bps | ');
echo (''.format_si(($vsvr['vsvr_bps_out'] * 8)).'bps | ');
echo '
';
if ($vars['view'] == 'graphs') {
echo '';
echo '';
$graph_type = 'netscalervsvr_'.$vars['graph'];
$graph_array['height'] = '100';
$graph_array['width'] = '213';
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $vsvr['vsvr_id'];
$graph_array['type'] = $graph_type;
include 'includes/print-graphrow.inc.php';
echo '
|
';
}
echo '';
echo '';
$i++;
}//end foreach
echo '
';
}//end if