VServer » "); // echo('All'); // print_optionbar_end(); $graph_types = array( 'bits' => 'Bits', 'pkts' => 'Packets', 'conns' => 'Connections', 'reqs' => 'Requests', 'hitmiss' => 'Hit/Miss', ); $i = 0; echo "
"; // Table header echo ""; echo ""; // Vserver graphs // Can this really return more than one row? $vservers = dbFetchRows('SELECT * FROM `netscaler_vservers` WHERE `device_id` = ? AND `vsvr_id` = ? ORDER BY `vsvr_name`', array($device['device_id'], $vars['vsvr'])); foreach ($vservers as $vsvr) { if (is_integer($i / 2)) { $bg_colour = \LibreNMS\Config::get('list_colour.even'); } else { $bg_colour = \LibreNMS\Config::get('list_colour.odd'); } if ($vsvr['vsvr_state'] == 'up') { $vsvr_label = 'success'; } elseif ($vsvr['vsvr_state'] == 'down') { $vsvr_label = 'danger'; } else { $vsvr_label = 'default'; } echo ""; echo ''; echo ''; echo "'; echo ''; echo (''); echo (''); echo ''; foreach ($graph_types as $graph_type => $graph_text) { $i++; echo ''; echo ''; } }//end foreach echo '
VServerVIP and portStateTypeInbound trafficOutbound traffic
'.$vsvr['vsvr_name'].'' . $vsvr['vsvr_ip'] . ':' . $vsvr['vsvr_port'] . '" . $vsvr['vsvr_state'] . '' . $vsvr['vsvr_type'] . ''.format_si(($vsvr['vsvr_bps_in'] * 8)).'bps'.format_si(($vsvr['vsvr_bps_out'] * 8)).'bps
'; $graph_type = 'netscalervsvr_'.$graph_type; $graph_array['height'] = '100'; $graph_array['width'] = '213'; $graph_array['to'] = \LibreNMS\Config::get('time.now'); $graph_array['id'] = $vsvr['vsvr_id']; $graph_array['type'] = $graph_type; echo '

'.$graph_text.'

'; include 'includes/html/print-graphrow.inc.php'; 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 ''.$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 ""; } echo ''.$descr.''; if ($vars['graph'] == $type) { echo ''; } $type_sep = ' | '; } print_optionbar_end(); echo "
"; // Table header echo ""; echo ""; echo ""; echo ""; // Vserver list $vservers = dbFetchRows('SELECT * FROM `netscaler_vservers` WHERE `device_id` = ? ORDER BY `vsvr_name`', array($device['device_id'])); // Vserver sorting $valid_sort_keys = array('vsvr_bps_in', 'vsvr_bps_out', 'vsrv_name'); if (isset($vars['sort']) && in_array($vars['sort'], $valid_sort_keys)) { $sort_key = $vars['sort']; } else { $sort_key = 'vsvr_name'; } switch ($sort_key) { case 'vsvr_bps_in': case 'vsvr_bps_out': $sort_direction = SORT_DESC; break; default: $sort_direction = SORT_ASC; } $vservers = array_sort_by_column($vservers, $sort_key, $sort_direction); $i = '0'; foreach ($vservers as $vsvr) { if (is_integer($i / 2)) { $bg_colour = \LibreNMS\Config::get('list_colour.even'); } else { $bg_colour = \LibreNMS\Config::get('list_colour.odd'); } if ($vsvr['vsvr_state'] == 'up') { $vsvr_label = 'success'; } elseif ($vsvr['vsvr_state'] == 'down') { $vsvr_label = 'danger'; } else { $vsvr_label = 'default'; } echo ""; echo ''; echo ''; echo "'; echo ''; echo (''); echo (''); echo ''; if ($vars['view'] == 'graphs') { echo ''; echo ''; } echo ''; echo ''; $i++; }//end foreach echo '
VServerVIP and portStateTypeInbound trafficOutbound traffic
'.$vsvr['vsvr_name'].'' . $vsvr['vsvr_ip'] . ':' . $vsvr['vsvr_port'] . '" . $vsvr['vsvr_state'] . '' . $vsvr['vsvr_type'] . ''.format_si(($vsvr['vsvr_bps_in'] * 8)).'bps'.format_si(($vsvr['vsvr_bps_out'] * 8)).'bps
'; $graph_type = 'netscalervsvr_'.$vars['graph']; $graph_array['height'] = '100'; $graph_array['width'] = '213'; $graph_array['to'] = \LibreNMS\Config::get('time.now'); $graph_array['id'] = $vsvr['vsvr_id']; $graph_array['type'] = $graph_type; include 'includes/html/print-graphrow.inc.php'; echo '
'; }//end if