Explorar o código

remove deprecated option fdb_snmp_index

rajven %!s(int64=4) %!d(string=hai) anos
pai
achega
c674b02134

+ 2 - 3
html/admin/devices/editdevice.php

@@ -54,7 +54,6 @@ if (isset($_POST["editdevice"]) and isset($id)) {
     if (isset($_POST["f_snmp3_user_ro"])) { $new['snmp3_user_ro'] = substr($_POST["f_snmp3_user_ro"], 0, 20); }
     if (isset($_POST["f_snmp3_user_rw_password"])) { $new['snmp3_user_rw_password'] = substr($_POST["f_snmp3_user_rw_password"], 0, 20); }
     if (isset($_POST["f_snmp3_user_ro_password"])) { $new['snmp3_user_ro_password'] = substr($_POST["f_snmp3_user_ro_password"], 0, 20); }
-    if (isset($_POST["f_fdb_snmp"])) { $new['fdb_snmp_index'] = $_POST["f_fdb_snmp"]; }
     if (isset($_POST["f_discovery"])) { $new['discovery'] = $_POST["f_discovery"]; }
     if (isset($_POST["f_dhcp"])) { $new['dhcp'] = $_POST["f_dhcp"] * 1; }
     if (isset($_POST["f_user_acl"])) { $new['user_acl'] = $_POST["f_user_acl"] * 1; }
@@ -140,7 +139,7 @@ if ($device['device_type']==2) {
 ?>
 </tr>
 <td>Snmp Version</td>
-<td>fdb by snmp</td>
+<td></td>
 <td>Discovery</td>
 <td>Nagios</td>
 <td>
@@ -148,7 +147,7 @@ if ($device['device_type']==2) {
 <?php
 print "<tr>\n";
 print "<td class=\"data\">"; print_snmp_select('f_snmp_version', $device['snmp_version']); print "</td>\n";
-print "<td class=\"data\">"; print_qa_select('f_fdb_snmp', $device['fdb_snmp_index']); print "</td>\n";
+print "<td class=\"data\"></td>\n";
 print "<td class=\"data\">"; print_qa_select('f_discovery', $device['discovery']); print "</td>\n";
 print "<td class=\"data\">"; print_qa_select('f_nagios', $device['nagios']); print "</td>\n";
 print "</tr>\n";

+ 2 - 5
html/admin/devices/portmactable.php

@@ -14,18 +14,15 @@ require_once ($_SERVER['DOCUMENT_ROOT']."/inc/idfilter.php");
 <div id="cont">
 <?php
 $port_id = $id;
-$sSQL = "SELECT DP.port, DP.snmp_index, D.device_name, D.ip, D.snmp_version, D.community, D.fdb_snmp_index FROM `device_ports` AS DP, devices AS D WHERE D.id = DP.device_id AND DP.id=$port_id";
+$sSQL = "SELECT DP.port, DP.snmp_index, D.device_name, D.ip, D.snmp_version, D.community  FROM `device_ports` AS DP, devices AS D WHERE D.id = DP.device_id AND DP.id=$port_id";
 $port_info = mysqli_query($db_link, $sSQL);
-list ($f_port, $f_snmp_index, $f_switch, $f_ip, $f_version, $f_community, $f_snmp) = mysqli_fetch_array($port_info);
+list ($f_port, $f_snmp_index, $f_switch, $f_ip, $f_version, $f_community) = mysqli_fetch_array($port_info);
 $display_name = " $f_port свича $f_switch";
 print "<b>$f_switch [$f_port] </b><br>\n";
 
 if ($f_snmp_index > 0) {
     print "<table class=\"data\" cellspacing=\"1\" cellpadding=\"4\">\n";
     print "<tr><td><b>Список маков активных на порту</b></td></tr>\n";
-    if (! $f_snmp) {
-        $f_snmp_index = $f_port;
-    }
     $fdb = get_fdb_port_table($f_ip, $f_snmp_index, $f_community, $f_version);
     foreach ($fdb as $a_mac => $a_port) {
         print "<tr>";

+ 2 - 6
html/admin/devices/switchstatus.php

@@ -98,7 +98,7 @@ if ($switch['snmp_version']>0) {
         print "<tr align=center>\n";
         $cl = "up";
         if (isset($switch['ip']) and ($switch['ip'] != '') and $snmp_ok) {
-            $port_state_detail = get_port_state_detail($d_snmp, $switch['ip'], $switch['community'], $switch['snmp_version'], $switch['fdb_snmp_index']);
+            $port_state_detail = get_port_state_detail($d_snmp, $switch['ip'], $switch['community'], $switch['snmp_version']);
             list ($poper, $padmin, $pspeed, $perrors) = explode(';', $port_state_detail);
             if (preg_match('/up/i', $poper)) {
                 $cl = "up";
@@ -127,11 +127,7 @@ if ($switch['snmp_version']>0) {
         print "</td>\n";
         print "<td class=\"$cl\">" . $d_comment . "</td>\n";
         if ($snmp_ok) {
-            if ($switch['fdb_snmp_index']) {
-                $vlan = get_port_vlan($d_snmp, $switch['ip'], $switch['community'], $switch['snmp_version'], $switch['fdb_snmp_index']);
-            } else {
-                $vlan = get_port_vlan($d_port, $switch['ip'], $switch['community'], $switch['snmp_version'], $switch['fdb_snmp_index']);
-            }
+            $vlan = get_port_vlan($d_snmp, $switch['ip'], $switch['community'], $switch['snmp_version']);
             $ifname = get_snmp_ifname($switch['ip'], $switch['community'], $switch['snmp_version'], $d_snmp);
             $sfp_status = get_sfp_status($switch['vendor_id'], $d_snmp, $switch['ip'], $switch['community'], $switch['snmp_version'], $modules_oids);
             $poe_status = get_port_poe_state($switch['vendor_id'], $d_snmp, $switch['ip'], $switch['community'], $switch['snmp_version']);

+ 1 - 0
html/inc/common.php

@@ -1728,6 +1728,7 @@ function get_fdb_port_table($ip, $port_index, $community, $version)
         if (! $vlan_table) {
             return;
         }
+        //fucking cisco!!!
         foreach ($vlan_table as $vlan_oid => $value) {
             if (! $vlan_oid) { continue; }
             $pattern = '/\.(\d{1,4})$/';