diff --git a/lib/mactrack_cisco.php b/lib/mactrack_cisco.php index 83e23a06..168e9068 100644 --- a/lib/mactrack_cisco.php +++ b/lib/mactrack_cisco.php @@ -298,6 +298,16 @@ function get_IOS_dot1dTpFdbEntry_ports($site, &$device, $lowPort = 0, $highPort $vlan_names = xform_standard_indexed_data('.1.3.6.1.4.1.9.9.46.1.3.1.1.4', $device); $vlan_trunkstatus = xform_standard_indexed_data('.1.3.6.1.4.1.9.9.46.1.6.1.1.14', $device); + if (sizeof($vlan_names) == 0) { + cacti_log('No VLANs Name found: ' . $device['device_name']); + return $device; + } + + if (sizeof($vlan_trunkstatus) == 0) { + cacti_log('No VLANs Trunk Status found: ' . $device['device_name']); + return $device; + } + $device['vlans_total'] = cacti_sizeof($vlan_ids) - 4; mactrack_debug('There are ' . (cacti_sizeof($vlan_ids)-4) . ' VLANS.'); @@ -495,6 +505,10 @@ function get_IOS_dot1dTpFdbEntry_ports($site, &$device, $lowPort = 0, $highPort $portTrunkStatus = (isset($ifInterfaces[$ifIndex]['trunkPortState']) ? $ifInterfaces[$ifIndex]['trunkPortState'] : ''); /* only output legitimate end user ports */ + /* ifType: 6 = ethernetCsmacd + 53 = propVirtual + 161 = ieee8023adLag + */ if ($ifType == 6 || $ifType == 53 || $ifType == 161) { if (($portTrunkStatus == '2') || (empty($portTrunkStatus)) || diff --git a/lib/mactrack_functions.php b/lib/mactrack_functions.php index 394d390a..04185942 100644 --- a/lib/mactrack_functions.php +++ b/lib/mactrack_functions.php @@ -262,6 +262,16 @@ function valid_snmp_device(&$device) { $device['snmp_priv_protocol'], $device['snmp_context'], $device['snmp_port'], $device['snmp_timeout'], $device['snmp_retries']); + // FortiGate + if ($snmp_sysDescr == '') { + $snmp_sysDescr = @cacti_snmp_get($device['hostname'], $device['snmp_readstring'], + '.1.3.6.1.2.1.47.1.2.1.1.2.1', $device['snmp_version'], + $device['snmp_username'], $device['snmp_password'], + $device['snmp_auth_protocol'], $device['snmp_priv_passphrase'], + $device['snmp_priv_protocol'], $device['snmp_context'], + $device['snmp_port'], $device['snmp_timeout'], $device['snmp_retries']); + } + if ($snmp_sysDescr != '') { $snmp_sysDescr = trim(strtr($snmp_sysDescr,'"',' ')); $device['snmp_sysDescr'] = $snmp_sysDescr; @@ -1344,8 +1354,8 @@ function get_base_dot1dTpFdbEntry_ports($site, &$device, &$ifInterfaces, $snmp_r $brPortIfType = @$ifInterfaces[$port_key['port_number']]['ifType']; } - if (($brPortIfType >= 6) && - ($brPortIfType <= 9) && + if (($brPortIfType >= 6 && $brPortIfType <= 9) || + $brPortIfType == 53 || $brPortIfType == 161) && (!isset($ifInterfaces[$brPortIfIndex]['portLink']))) { /* set some defaults */ $new_port_key_array[$i]['vlan_id'] = 'N/A';