' . PHP_EOL); // Moved on XL screen to panel side include($config['html_dir']."/includes/status-summary.inc.php"); echo('' . PHP_EOL); break; case "status_donuts": $div_class = "col-md-12"; // Class for each block echo('
' . PHP_EOL); // Moved on XL screen to panel side include($config['html_dir']."/includes/status-donuts.inc.php"); echo('
' . PHP_EOL); break; case "cable-map": include($config['html_dir']."/includes/cable-map.inc.php"); break; case "map": //include($config['html_dir']."/includes/map.inc.php"); show_map($config); break; case "device_status_boxes": show_status_boxes($config); break; case "device_status": show_status($config); break; case "alert_status": include("includes/alert-status.inc.php"); break; case "overall_traffic": show_traffic($config); break; case "custom_traffic": show_customtraffic($config); break; case "alert_table": print_alert_table(array('status' => 'failed', 'pagination' => FALSE, 'short' => TRUE, 'header' => array('title' => 'Current Alerts', 'url' => '/alerts/' ) )); break; case "splitlog": show_splitlog($config); break; case "syslog": show_syslog($config); break; case "eventlog": show_eventlog($config); break; case "minigraphs": show_minigraphs($config); break; case "micrographs": show_micrographs($config); break; case "portpercent": include($config['html_dir']."/includes/status-portpercent.inc.php"); break; } } // FIXME, make this function generic for use in any place // MOVEME html/includes/print/maps.inc.php function show_map($config) { ?>
= '5') { $ports = array(); $query_permitted = generate_query_permitted(array('port')); foreach (dbFetchRows("SELECT `port_descr_type`,`port_id`,`ifAlias` FROM `ports` WHERE `port_descr_type` IS NOT NULL $query_permitted ORDER BY `ifAlias`") as $port) { switch ($port['port_descr_type']) { case 'transit': case 'peering': case 'core': $ports[$port['port_descr_type']][] = $port['port_id']; break; } } echo generate_box_open(); $links['transit'] = generate_url(array("page" => "iftype", "type" => "transit")); $ports['transit_list'] = implode(',', $ports['transit']); $graph_array['from'] = $config['time']['day']; $graph_array['to'] = $config['time']['now']; $graph_array['type'] = 'multi-port_bits_separate'; $graph_array['width'] = 528; $graph_array['height'] = 100; $graph_array['legend'] = 'no'; $graph_array['id'] = $ports['transit_list']; $transit_graph = generate_graph_tag($graph_array); $graph_array['from'] = $config['time']['week']; $transit_graph_week = generate_graph_tag($graph_array); $links['peering'] = generate_url(array("page" => "iftype", "type" => "peering")); $ports['peering_list'] = implode(',', $ports['peering']); $graph_array['from'] = $config['time']['day']; $graph_array['id'] = $ports['peering_list']; $peering_graph = generate_graph_tag($graph_array); $graph_array['from'] = $config['time']['week']; $peering_graph_week = generate_graph_tag($graph_array); $graph_array['id'] = $ports['peering_list']; $graph_array['idb'] = $ports['transit_list']; $graph_array['from'] = $config['time']['month']; $graph_array['type'] = 'multi-port_bits_duo_separate'; $graph_array['width'] = 1158; $summary_graph = generate_graph_tag($graph_array); if (count($ports['transit']) && count($ports['peering'])) { echo('
'); echo('
'); echo('

Overall Transit Traffic Today

'); echo(' '.$transit_graph.''); echo('
'); echo('
'); echo('

Overall Peering Traffic Today

'); echo(' '.$peering_graph.''); echo('
'); echo('
'); } elseif (count($ports['transit'])) { echo('
'); echo('
'); echo('

Overall Transit Traffic Today

'); echo(' '.$transit_graph.''); echo('
'); echo('
'); echo('

Overall Transit Traffic This Week

'); echo(' '.$transit_graph_week.''); echo('
'); echo('
'); } elseif (count($ports['peering'])) { $links['peering'] = generate_url(array("page" => "iftype", "type" => "peering")); $ports['peering_list'] = implode(',', $ports['peering']); echo('
'); echo('
'); echo('

Overall Peering Traffic Today

'); echo(' '.$peering_graph.''); echo('
'); echo('
'); echo('

Overall Peering Traffic This Week

'); echo(' '.$peering_graph_week.''); echo('
'); echo('
'); } if ($ports['transit_list'] && $ports['peering_list']) { $links['peer_trans'] = generate_url(array("page" => "iftype", "type" => "peering,transit")); echo('
'); echo('
'); echo('

Overall Transit & Peering Traffic This Month

'); echo(' '.$summary_graph.''); echo('
'); echo('
'); } echo generate_box_close(); } } // End show_traffic function show_customtraffic($config) { // Show Custom Traffic if ($_SESSION['userlevel'] >= '5') { echo generate_box_open(); $config['frontpage']['custom_traffic']['title'] = (empty($config['frontpage']['custom_traffic']['title']) ? "Custom Traffic" : $config['frontpage']['custom_traffic']['title']); echo('
'); echo('
'); echo('

'.$config['frontpage']['custom_traffic']['title'].' Today

'); echo(' '); echo('
'); echo('
'); echo('

'.$config['frontpage']['custom_traffic']['title'].' This Week

'); echo(' '); echo('
'); echo('
'); echo('
'); echo('
'); echo('

'.$config['frontpage']['custom_traffic']['title'].' This Month

'); echo(' '); echo('
'); echo('
'); echo generate_box_close(); } } // End show_customtraffic function show_minigraphs($config) { // Show Custom MiniGraphs if ($_SESSION['userlevel'] >= '5' && $config['frontpage']['minigraphs']['ids'] != '') { $minigraphs = explode(';', $config['frontpage']['minigraphs']['ids']); $width = $config['frontpage']['minigraphs']['width']; $height = $config['frontpage']['minigraphs']['height']; $legend = (($config['frontpage']['minigraphs']['legend'] == false) ? 'no' : 'yes'); echo generate_box_open(); echo('
'); echo('
'); if ($config['frontpage']['minigraphs']['title']) { echo('

'.$config['frontpage']['minigraphs']['title'].'

'); } foreach ($minigraphs as $graph) { if (!$graph) { continue; } // Skip empty graphs from excess semicolons list($device, $type, $header) = explode(',', $graph, 3); if (strpos($type, 'device') === false) { if (strpos($type, 'multi') !== false) // Copy/pasted id= from multi graph url works, prevents broken uri { $links = generate_url(array('page' => 'graphs', 'type' => $type, 'id' => urldecode($device))); } else { $links = generate_url(array('page' => 'graphs', 'type' => $type, 'id' => $device)); } //, 'from' => $config['time']['day'], 'to' => $config['time']['now'])); echo('

'.$header.'

'); } else { $links = generate_url(array('page' => 'graphs', 'type' => $type, 'device' => $device)); //, 'from' => $config['time']['day'], 'to' => $config['time']['now'])); echo('

'.$header.'

'); // Apply custom dimensions to device graphs } } unset($links); echo('
'); echo('
'); echo generate_box_close(); } } // End show_minigraphs function show_micrographs($config) { if ($_SESSION['userlevel'] >= '5' && $config['frontpage']['micrographs'] != '') { $width = $config['frontpage']['micrograph_settings']['width']; $height = $config['frontpage']['micrograph_settings']['height']; echo generate_box_open(); echo('
'); echo('
'); echo(' '); echo(' '); foreach ($config['frontpage']['micrographs'] as $row) { $micrographs = explode(';', $row['ids']); $legend = (($row['legend'] == false) ? 'no' : 'yes'); echo(' '); if ($row['title']) { echo(' '); } echo(' '); echo(' '); } echo(' '); echo('
'.$row['title'].''); foreach ($micrographs as $graph) { if (!$graph) { continue; } // Skip empty graphs from excess semicolons list($device, $type, $header) = explode(',', $graph, 3); if (strpos($type, 'device') === false) { $which = 'id'; if (strpos($type, 'multi') !== false) // Copy/pasted id= from multi graph url works, prevents broken uri { $links = generate_url(array('page' => 'graphs', 'type' => $type, 'id' => urldecode($device))); } else { $links = generate_url(array('page' => 'graphs', 'type' => $type, 'id' => $device)); } } else { $which = 'device'; $links = generate_url(array('page' => 'graphs', 'type' => $type, 'device' => $device)); } echo('
'); if ($header) { echo('

'.$header.'

'); } echo(''); echo('
'); } unset($links); echo('
'); echo('
'); echo('
'); echo generate_box_close(); } } // End show_micrographs function show_status($config) { echo generate_box_open(array('title' => 'Status Warnings and Notifications', 'url' => '/alerts/', 'header-border' => TRUE)); generate_status_table($config['frontpage']['device_status']); echo generate_box_close(); } function show_portpercent($config) { if ($config['frontpage']['portpercent'] != '') { echo generate_box_open(array('title' => 'Port Utilization by Type', 'url' => '/groups/entity_type=port/', 'header-border' => TRUE)); echo(''); echo generate_box_close(); } } function show_status_boxes($config) { echo('
' . PHP_EOL); echo('
' . PHP_EOL); print_status_boxes($config['frontpage']['device_status']); echo('
' . PHP_EOL); echo('
' . PHP_EOL); } function show_syslog($config) { print_syslogs(array('short' => TRUE, 'pagesize' => $config['frontpage']['syslog']['items'], 'priority' => $config['frontpage']['syslog']['priority'], 'header' => array('url' => '/syslog/', 'title' => 'Recent Syslog Messages', 'header-border' => TRUE))); } function show_eventlog($config) { print_events(array('short' => TRUE, 'pagesize' => $config['frontpage']['eventlog']['items'], 'severity' => $config['frontpage']['eventlog']['severity'], 'header' => array('url' => '/eventlog/', 'title' => 'Recent Events', 'header-border' => TRUE))); } function show_splitlog($config) { echo '
' . PHP_EOL; echo '
' . PHP_EOL; print_events(array('short' => TRUE, 'pagesize' => $config['frontpage']['eventlog']['items'], 'severity' => $config['frontpage']['eventlog']['severity'], 'header' => array('url' => '/eventlog/', 'title' => 'Recent Events', 'header-border' => TRUE))); echo '
'; echo '
' . PHP_EOL; print_syslogs(array('short' => TRUE, 'pagesize' => $config['frontpage']['syslog']['items'], 'priority' => $config['frontpage']['syslog']['priority'], 'header' => array('url' => '/syslog/', 'title' => 'Recent Syslog Messages', 'header-border' => TRUE))); echo '
'; echo '
'; } // EOF