diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index 9a8e40527c..1ad94eb7b4 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -815,6 +815,7 @@ $config['poller_modules']['cisco-asa-firewall'] = false; $config['poller_modules']['cisco-voice'] = false; $config['poller_modules']['cisco-cbqos'] = false; $config['poller_modules']['cisco-otv'] = false; +$config['poller_modules']['cisco-qfp'] = false; $config['poller_modules']['cisco-vpdn'] = false; $config['poller_modules']['nac'] = false; $config['poller_modules']['netscaler-vsvr'] = false; @@ -846,6 +847,7 @@ $config['discovery_modules']['cisco-cef'] = false; $config['discovery_modules']['cisco-sla'] = false; $config['discovery_modules']['cisco-cbqos'] = false; $config['discovery_modules']['cisco-otv'] = false; +$config['discovery_modules']['cisco-qfp'] = false; $config['discovery_modules']['ipv4-addresses'] = true; $config['discovery_modules']['ipv6-addresses'] = true; $config['discovery_modules']['route'] = false; diff --git a/includes/definitions/iosxe.yaml b/includes/definitions/iosxe.yaml index 54692dc1ac..4feb1b5d01 100644 --- a/includes/definitions/iosxe.yaml +++ b/includes/definitions/iosxe.yaml @@ -22,6 +22,7 @@ poller_modules: cisco-otv: true ipmi: false cisco-vpdn: true + cisco-qfp: true discovery_modules: cisco-cef: true cisco-sla: true @@ -30,6 +31,7 @@ discovery_modules: cisco-pw: true vrf: true cisco-vrf-lite: true + cisco-qfp: true register_mibs: ciscoAAASessionMIB: CISCO-AAA-SESSION-MIB discovery: diff --git a/includes/discovery/cisco-qfp.inc.php b/includes/discovery/cisco-qfp.inc.php new file mode 100644 index 0000000000..066e6130a5 --- /dev/null +++ b/includes/discovery/cisco-qfp.inc.php @@ -0,0 +1,123 @@ + + */ + +if ($device['os_group'] == 'cisco') { + $module = 'cisco-qfp'; + + /* + * CISCO-ENTITY-QFP-MIB::ceqfpSystemState values + */ + $system_states = array( + 1 => 'unknown', + 2 => 'reset', + 3 => 'init', + 4 => 'active', + 5 => 'activeSolo', + 6 => 'standby', + 7 => 'hotStandby' + ); + + /* + * CISCO-ENTITY-QFP-MIB::ceqfpSystemTrafficDirection values + */ + $system_traffic_direction = array ( + 1 => 'none', + 2 => 'ingress', + 3 => 'egress', + 4 => 'both' + ); + + /* + * Get module's components for a device + */ + $component = new LibreNMS\Component(); + $components = $component->getComponents($device['device_id'], array('type'=>$module)); + $components = $components[$device['device_id']]; + + /* + * Walk through CISCO-ENTITY-QFP-MIB::ceqfpSystemTable + */ + $qfp_general_data = snmpwalk_group($device, 'ceqfpSystemTable', 'CISCO-ENTITY-QFP-MIB'); + if ($qfp_general_data) { + /* + * Loop through SNMP data and add or update components + */ + foreach ($qfp_general_data as $qfp_index => $data) { + /* + * Get entPhysicalName for QFP + */ + $qfp_name_oid = '.1.3.6.1.2.1.47.1.1.1.1.7.' . $qfp_index; + $qfp_name_data = snmp_get_multi_oid($device, [$qfp_name_oid]); + $qfp_name = $qfp_name_data[$qfp_name_oid]; + + /* + * Component data array for `component_prefs` + */ + $component_data = array( + 'label' => 'qfp_' . $qfp_index, + 'entPhysicalIndex' => $qfp_index, + 'name' => $qfp_name, + 'traffic_direction' => $system_traffic_direction[$data['ceqfpSystemTrafficDirection']], + 'system_state' => $system_states[$data['ceqfpSystemState']], + 'system_loads' => $data['ceqfpNumberSystemLoads'], + 'system_last_load' => $data['ceqfpSystemLastLoadTime'] + ); + + /* + * Find existing component ID if QFP is already known + */ + $component_id = false; + foreach ($components as $tmp_component_id => $tmp_component) { + if ($tmp_component['entPhysicalIndex'] == $qfp_index) { + $component_id = $tmp_component_id; + } + } + + /* + * If $component_id is false QFP Component doesn't exist + * Create new component and add it to $components array + */ + if (!$component_id) { + $new_component = $component->createComponent($device['device_id'], $module); + $component_id = key($new_component); + $components[$component_id] = array_merge($new_component[$component_id], $component_data); + echo '+'; + } else { + $components[$component_id] = array_merge($components[$component_id], $component_data); + echo '.'; + } + } + } + + /* + * Loop trough components, check against SNMP QFP indexes and delete if needed + */ + foreach ($components as $tmp_component_id => $tmp_component) { + $found = in_array($tmp_component['entPhysicalIndex'], array_keys($qfp_general_data)); + if (!$found) { + $component->deleteComponent($tmp_component_id); + echo '-'; + } + } + + /* + * Save components + */ + $component->setComponentPrefs($device['device_id'], $components); + + echo "\n"; +} diff --git a/includes/html/graphs/device/qfp.inc.php b/includes/html/graphs/device/qfp.inc.php new file mode 100644 index 0000000000..85a845b737 --- /dev/null +++ b/includes/html/graphs/device/qfp.inc.php @@ -0,0 +1,52 @@ + + */ + +/* + * Get module's components for a device + */ +$component = new LibreNMS\Component(); +$components = $component->getComponents($device['device_id'], array('type' => 'cisco-qfp')); +$components = $components[$device['device_id']]; + +/* + * Iterate over QFP components and create rrd_list array entry for each of them + */ +$i = 1; +foreach ($components as $component_id => $tmp_component) { + $rrd_filename = rrd_name($device['hostname'], array('cisco-qfp', 'util', $tmp_component['entPhysicalIndex'])); + + if (rrdtool_check_rrd_exists($rrd_filename)) { + $descr = short_hrDeviceDescr($tmp_component['name']); + + $rrd_list[$i]['filename'] = $rrd_filename; + $rrd_list[$i]['descr'] = $descr; + $rrd_list[$i]['ds'] = 'ProcessingLoad'; + $rrd_list[$i]['area'] = 1; + $i++; + } +} + +$unit_text = 'Util %'; + +$units = ''; +$total_units = '%'; +$colours = 'mixed'; + +$scale_min = '0'; +$scale_max = '100'; + +$nototal = 1; + +require 'includes/html/graphs/generic_multi_line.inc.php'; diff --git a/includes/html/graphs/qfp/auth.inc.php b/includes/html/graphs/qfp/auth.inc.php new file mode 100644 index 0000000000..99e3aeaf97 --- /dev/null +++ b/includes/html/graphs/qfp/auth.inc.php @@ -0,0 +1,62 @@ + + */ + +/* + * Get a single module component with specified ID + */ +if (isset($vars['id'])) { + $component = new LibreNMS\Component(); + $filter = array( + 'filter' => array( + 'type' => array('=', 'cisco-qfp'), + 'id' => array('=', $vars['id']) + ) + ); + $components = $component->getComponents(null, $filter); + /* + * Fist (and only) key is the device ID + */ + $device_id = key($components); + /* + * Check if component exists and we're authenticated + */ + if ($components && isset($components[$device_id][$vars['id']]) && ($auth || device_permitted($device_id))) { + $components = $components[$device_id][$vars['id']]; + $device = device_by_id_cache($device_id); + + /* + * Data is split into just two RRD files, memory resources and utilization + */ + if ($subtype == 'memory') { + $rrd_filename = rrd_name($device['hostname'], array('cisco-qfp', 'memory', $components['entPhysicalIndex'])); + } else { + $rrd_filename = rrd_name($device['hostname'], array('cisco-qfp', 'util', $components['entPhysicalIndex'])); + } + + /* + * Build title with breadcrumbs for module's main subpage + */ + $link_array = array( + 'page' => 'device', + 'device' => $device['device_id'], + 'tab' => 'health', + ); + $title = generate_device_link($device); + $title .= ' :: ' . generate_link("QFP", $link_array, array('metric' => 'qfp')); + $title .= ' :: ' . $components['name']; + + $auth = true; + } +} diff --git a/includes/html/graphs/qfp/avgpktsize.inc.php b/includes/html/graphs/qfp/avgpktsize.inc.php new file mode 100644 index 0000000000..51d2ea5563 --- /dev/null +++ b/includes/html/graphs/qfp/avgpktsize.inc.php @@ -0,0 +1,71 @@ + + */ + +$colour_area_in = 'AA66AA'; +$colour_line_in = '330033'; + +$colour_area_out = 'FFDD88'; +$colour_line_out = 'FF6600'; + +$colour_area_in_max = 'cc88cc'; +$colour_area_out_max = 'FFefaa'; + +$graph_max = 1; + +require 'includes/html/graphs/common.inc.php'; + +$stacked = generate_stacked_graphs(); + +$length = '10'; + +if (!isset($out_text)) { + $out_text = 'Out'; +} + +if (!isset($in_text)) { + $in_text = 'In'; +} + +$unit_text = str_pad(truncate($unit_text, $length), $length); +$in_text = str_pad(truncate($in_text, $length), $length); +$out_text = str_pad(truncate($out_text, $length), $length); + +$rrd_options .= ' DEF:in_packets=' . $rrd_filename . ':InTotalPps:AVERAGE'; +$rrd_options .= ' DEF:out_packets=' . $rrd_filename . ':OutTotalPps:AVERAGE'; +$rrd_options .= ' DEF:in_bits=' . $rrd_filename . ':InTotalBps:AVERAGE'; +$rrd_options .= ' DEF:out_bits=' . $rrd_filename . ':OutTotalBps:AVERAGE'; + +$rrd_options .= ' CDEF:in_throughput=in_bits,8,/'; +$rrd_options .= ' CDEF:out_throughput=out_bits,8,/'; + +$rrd_options .= ' CDEF:in_avg=in_throughput,in_packets,/'; +$rrd_options .= ' CDEF:out_avg_tmp=out_throughput,out_packets,/'; +$rrd_options .= ' CDEF:out_avg=out_avg_tmp,-1,*'; + + +$rrd_options .= ' AREA:in_avg#' . $colour_area_in . $stacked['transparency'] . ':'; +$rrd_options .= " COMMENT:'Average packet size\\n'"; +$rrd_options .= ' LINE1.25:in_avg#' . $colour_line_in . ":'" . $in_text . "'"; +$rrd_options .= ' GPRINT:in_avg:AVERAGE:%6.2lf%sB'; +$rrd_options .= " COMMENT:\\n"; + +$rrd_options .= ' AREA:out_avg#' . $colour_area_out . $stacked['transparency'] . ':'; +$rrd_options .= ' LINE1.25:out_avg#' . $colour_line_out . ":'" . $out_text . "'"; +$rrd_options .= ' GPRINT:out_avg_tmp:AVERAGE:%6.2lf%sB'; +$rrd_options .= " COMMENT:\\n"; + +$rrd_options .= ' HRULE:0#999999'; + +unset($stacked); diff --git a/includes/html/graphs/qfp/memory.inc.php b/includes/html/graphs/qfp/memory.inc.php new file mode 100644 index 0000000000..5f223fe28d --- /dev/null +++ b/includes/html/graphs/qfp/memory.inc.php @@ -0,0 +1,86 @@ + + */ + +require 'includes/html/graphs/common.inc.php'; + +$rrd_options .= ' -u 100 -l 0 -E -b 1024 '; + +$iter = '1'; + +if ($width > '500') { + $descr_len = 13; +} else { + $descr_len = 8; + $descr_len += round(($width - 250) / 8); +} + +if ($width > '500') { + $rrd_options .= " COMMENT:'".substr(str_pad($unit_text, ($descr_len + 5)), 0, ($descr_len + 5))."Total Used Free (Min Max Ave)'"; + $rrd_options .= " COMMENT:'\l'"; +} else { + $rrd_options .= " COMMENT:'".substr(str_pad($unit_text, ($descr_len + 5)), 0, ($descr_len + 5))."Total Used Free\l'"; +} + +$descr = rrdtool_escape(short_hrDeviceDescr($components['name']), $descr_len); + +$perc = $components['memory_used']*100/$components['memory_total']; + +$background = get_percentage_colours($perc, 75); + +$rrd_options .= " DEF:qfp_used=$rrd_filename:InUse:AVERAGE"; +$rrd_options .= " DEF:qfp_free=$rrd_filename:Free:AVERAGE"; +$rrd_options .= " DEF:qfp_size=$rrd_filename:Total:AVERAGE"; +$rrd_options .= " DEF:qfp_low_watermark=$rrd_filename:LowFreeWatermark:AVERAGE"; +$rrd_options .= " DEF:qfp_ok_th=$rrd_filename:FallingThreshold:AVERAGE"; +$rrd_options .= " DEF:qfp_warn_th=$rrd_filename:RisingThreshold:AVERAGE"; +$rrd_options .= " CDEF:qfp_perc=qfp_used,qfp_size,/,100,*"; +$rrd_options .= " CDEF:qfp_percx=100,qfp_perc,-"; +$rrd_options .= " AREA:qfp_perc#".$background['right'].':'; +$rrd_options .= " CDEF:qfp_tmp_wmark=qfp_low_watermark,qfp_size,/,100,*"; +$rrd_options .= " CDEF:qfp_perc_wmark=100,qfp_tmp_wmark,-"; + + + +if ($width > '500') { + $rrd_options .= " LINE1.25:qfp_perc#".$background['left'].":'$descr'"; + $rrd_options .= " GPRINT:qfp_size:LAST:%6.2lf%sB"; + $rrd_options .= " GPRINT:qfp_used:LAST:%6.2lf%sB"; + $rrd_options .= " GPRINT:qfp_free:LAST:%6.2lf%sB"; + $rrd_options .= " GPRINT:qfp_free:MIN:%5.2lf%sB"; + $rrd_options .= " GPRINT:qfp_free:MAX:%5.2lf%sB"; + $rrd_options .= " GPRINT:qfp_free:AVERAGE:%5.2lf%sB\\n"; + $rrd_options .= " COMMENT:'".substr(str_pad('', ($descr_len + 12)), 0, ($descr_len + 12))." '"; + $rrd_options .= " GPRINT:qfp_perc:LAST:'%6.2lf%% '"; + $rrd_options .= " GPRINT:qfp_percx:LAST:'%6.2lf%% '"; + $rrd_options .= " GPRINT:qfp_perc:MIN:'%5.2lf%% '"; + $rrd_options .= " GPRINT:qfp_perc:MAX:'%5.2lf%% '"; + $rrd_options .= " GPRINT:qfp_perc:AVERAGE:%5.2lf%%\\n"; + $rrd_options .= " LINE2:qfp_perc_wmark#ffaaaa:'Most used'"; + $rrd_options .= " COMMENT:'\l'"; + $rrd_options .= " LINE1:qfp_warn_th#aa0000:'Threshold':dashes"; +} else { + $rrd_options .= " LINE1.25:qfp_perc#".$background['left'].":'$descr'"; + $rrd_options .= " GPRINT:qfp_size:LAST:%6.2lf%sB"; + $rrd_options .= " GPRINT:qfp_used:LAST:%6.2lf%sB"; + $rrd_options .= " GPRINT:qfp_free:LAST:%6.2lf%sB"; + $rrd_options .= " COMMENT:'\l'"; + $rrd_options .= " COMMENT:'".substr(str_pad('', ($descr_len + 12)), 0, ($descr_len + 12))." '"; + $rrd_options .= " GPRINT:qfp_perc:LAST:'%5.2lf%% '"; + $rrd_options .= " GPRINT:qfp_percx:LAST:'%5.2lf%% '"; + $rrd_options .= " COMMENT:'\l'"; + $rrd_options .= " LINE2:qfp_perc_wmark#ffaaaa:'Most used'"; + $rrd_options .= " COMMENT:'\l'"; + $rrd_options .= " LINE1:qfp_warn_th#aa0000:'Threshold':dashes"; +} diff --git a/includes/html/graphs/qfp/packets.inc.php b/includes/html/graphs/qfp/packets.inc.php new file mode 100644 index 0000000000..a7b055c5ba --- /dev/null +++ b/includes/html/graphs/qfp/packets.inc.php @@ -0,0 +1,48 @@ + + */ + +/* + * Priority packets handled by QFP + */ +$i = 1; +$rrd_list[$i]['filename'] = $rrd_filename; +$rrd_list[$i]['descr'] = $components['name']; +$rrd_list[$i]['ds_in'] = 'InPriorityPps'; +$rrd_list[$i]['ds_out'] = 'OutPriorityPps'; +$rrd_list[$i]['descr'] = 'Priority'; +$rrd_list[$i]['colour_area_in'] = 'FACF5A'; +$rrd_list[$i]['colour_area_out'] = 'FF5959'; + +/* + * Non-priority packets handled by QFP + */ +$i =2; +$rrd_list[$i]['filename'] = $rrd_filename; +$rrd_list[$i]['descr'] = $components['name']; +$rrd_list[$i]['ds_in'] = 'InNonPriorityPps'; +$rrd_list[$i]['ds_out'] = 'OutNonPriorityPps'; +$rrd_list[$i]['descr'] = 'NonPriority'; +$rrd_list[$i]['colour_area_in'] = '085F63'; +$rrd_list[$i]['colour_area_out'] = '49BEB7'; + +$units = 'pps'; +$units_descr = 'Packets/s'; +$colours_in = 'purples'; +$multiplier = '1'; +$colours_out = 'oranges'; + +$args['nototal'] = 1; + +include 'includes/html/graphs/generic_multi_seperated.inc.php'; diff --git a/includes/html/graphs/qfp/relativeutil.inc.php b/includes/html/graphs/qfp/relativeutil.inc.php new file mode 100644 index 0000000000..00ec298d90 --- /dev/null +++ b/includes/html/graphs/qfp/relativeutil.inc.php @@ -0,0 +1,38 @@ + + */ + +$colour_line = 'cc0000'; +$colour_area = 'FFBBBB'; +$colour_minmax = 'c5c5c5'; + +$graph_max = 1; +$line_text = $components['name']; +include 'includes/html/graphs/common.inc.php'; + +$line_text = str_pad(substr($line_text, 0, 12), 12); + + +$rrd_options .= ' DEF:in_pkts='.$rrd_filename.':InTotalPps:AVERAGE'; +$rrd_options .= ' DEF:out_pkts='.$rrd_filename.':OutTotalPps:AVERAGE'; +$rrd_options .= ' DEF:load='.$rrd_filename.':ProcessingLoad:AVERAGE'; +$rrd_options .= ' CDEF:total_kpps=in_pkts,out_pkts,+,1000,/'; +$rrd_options .= ' CDEF:relative=load,total_kpps,/'; + +$rrd_options .= ' AREA:relative#'.$colour_area.':'; +$rrd_options .= " COMMENT:'Load % per 1kpps'\\n"; +$rrd_options .= ' LINE1.25:relative#'.$colour_line.":'".$line_text."'"; +$rrd_options .= " COMMENT:\\n"; diff --git a/includes/html/graphs/qfp/throughput.inc.php b/includes/html/graphs/qfp/throughput.inc.php new file mode 100644 index 0000000000..c95696299f --- /dev/null +++ b/includes/html/graphs/qfp/throughput.inc.php @@ -0,0 +1,50 @@ + + */ + +/* + * Priority packets handled by QFP + */ +$i = 1; +$rrd_list[$i]['filename'] = $rrd_filename; +$rrd_list[$i]['descr'] = $components['name']; +$rrd_list[$i]['ds_in'] = 'InPriorityBps'; +$rrd_list[$i]['ds_out'] = 'OutPriorityBps'; +$rrd_list[$i]['descr'] = 'Priority'; +$rrd_list[$i]['colour_area_in'] = 'FACF5A'; +$rrd_list[$i]['colour_area_out'] = 'FF5959'; + +/* + * Non-priority packets handled by QFP + */ +$i = 2; +$rrd_list[$i]['filename'] = $rrd_filename; +$rrd_list[$i]['descr'] = $components['name']; +$rrd_list[$i]['ds_in'] = 'InNonPriorityBps'; +$rrd_list[$i]['ds_out'] = 'OutNonPriorityBps'; +$rrd_list[$i]['descr'] = 'NonPriority'; +$rrd_list[$i]['colour_area_in'] = '608720'; +$rrd_list[$i]['colour_area_out'] = '606090'; + + + +$units = 'pps'; +$units_descr = 'Bits/s'; +$colours_in = 'purples'; +$multiplier = '1'; +$colours_out = 'oranges'; + +$args['nototal'] = 1; + +include 'includes/html/graphs/generic_multi_seperated.inc.php'; diff --git a/includes/html/graphs/qfp/util.inc.php b/includes/html/graphs/qfp/util.inc.php new file mode 100644 index 0000000000..4d0f0fdc13 --- /dev/null +++ b/includes/html/graphs/qfp/util.inc.php @@ -0,0 +1,29 @@ + + */ + +$scale_min = '0'; +$scale_max = '100'; + +$ds = 'ProcessingLoad'; + +$colour_line = 'cc0000'; +$colour_area = 'FFBBBB'; +$colour_minmax = 'c5c5c5'; + +$graph_max = 1; +$unit_text = 'Utilization'; +$line_text = $components['name']; + +require 'includes/html/graphs/generic_simplex.inc.php'; diff --git a/includes/html/pages/device/health.inc.php b/includes/html/pages/device/health.inc.php index 7488f2ddba..0a3e2b8e26 100644 --- a/includes/html/pages/device/health.inc.php +++ b/includes/html/pages/device/health.inc.php @@ -5,6 +5,18 @@ $diskio = get_disks($device['device_id']); $mempools = dbFetchCell('select count(*) from mempools WHERE device_id = ?', array($device['device_id'])) + count_mib_mempools($device); $processor = dbFetchCell('select count(*) from processors WHERE device_id = ?', array($device['device_id'])) + count_mib_processors($device); +/* + * QFP count for cisco devices + */ +$qfp = 0; +if ($device['os_group'] == 'cisco') { + $component = new LibreNMS\Component(); + $components = $component->getComponents($device['device_id'], array('type'=> 'cisco-qfp')); + $components = $components[$device['device_id']]; + $qfp = count($components); +} + + $count = dbFetchCell("select count(*) from sensors WHERE sensor_class='count' AND device_id = ?", array($device['device_id'])); $temperatures = dbFetchCell("select count(*) from sensors WHERE sensor_class='temperature' AND device_id = ?", array($device['device_id'])); $humidity = dbFetchCell("select count(*) from sensors WHERE sensor_class='humidity' AND device_id = ?", array($device['device_id'])); @@ -38,6 +50,10 @@ if ($processor) { $datas[] = 'processor'; } +if ($qfp) { + $datas[] = 'qfp'; +} + if ($mempools) { $datas[] = 'mempool'; } @@ -185,6 +201,7 @@ $type_text['chromatic_dispersion'] = 'Chromatic Dispersion'; $type_text['ber'] = 'Bit Error Rate'; $type_text['eer'] = 'Energy Efficiency Ratio'; $type_text['waterflow'] = 'Water Flow Rate'; +$type_text['qfp'] = 'QFP'; $link_array = array( 'page' => 'device', @@ -225,7 +242,6 @@ if (is_file("includes/html/pages/device/health/$metric.inc.php")) { if ($type != 'overview') { $graph_title = $type_text[$type]; $graph_array['type'] = 'device_'.$type; - include 'includes/html/print-device-graph.php'; } } diff --git a/includes/html/pages/device/health/qfp.inc.php b/includes/html/pages/device/health/qfp.inc.php new file mode 100644 index 0000000000..210f763c59 --- /dev/null +++ b/includes/html/pages/device/health/qfp.inc.php @@ -0,0 +1,214 @@ + + */ + +/* + * Get module's components for a device + */ +$component = new LibreNMS\Component(); +$components = $component->getComponents($device['device_id'], array('type' => 'cisco-qfp')); +$components = $components[$device['device_id']]; + +foreach ($components as $component_id => $tmp_component) { + $default_graph_array = array( + 'from' => \LibreNMS\Config::get('time.day'), + 'to' => \LibreNMS\Config::get('time.now'), + 'id' => $component_id, + 'page' => 'graphs' + ); + + /* + * Main container for QFP component + * Header with system data + */ + switch ($tmp_component['system_state']) { + case 'active': + case 'activeSolo': + case 'standby': + case 'hotStandby': + $state_label = 'label-success'; + break; + case 'reset': + $state_label = 'label-danger'; + break; + case 'init': + $state_label = 'label-warning'; + break; + default: + $state_label = 'label-default'; + } + + switch ($tmp_component['traffic_direction']) { + case 'none': + $direction_label = 'label-danger'; + break; + case 'ingress': + case 'egress': + $direction_label = 'label-wanring'; + break; + case 'both': + $direction_label = 'label-success'; + break; + default: + $direction_label = 'label-default'; + } + + $text_descr = $tmp_component['name']; + echo "