Quellcode durchsuchen

Se agrega el método para leer los Puertos Gpon

Maximiliano Schvindt vor 7 Jahren
Ursprung
Commit
12ff604b7f
2 geänderte Dateien mit 10 neuen und 9 gelöschten Zeilen
  1. 7 6
      Command/HuaweiPonScanCommand.php
  2. 3 3
      SNMP/MIBS/OIDSHuaweiV1.php

+ 7 - 6
Command/HuaweiPonScanCommand.php

@@ -65,14 +65,15 @@ class HuaweiPonScanCommand extends BaseCommand
         foreach($ports as $index => $d) {
             //PON s/p
             if (preg_match("/pon/i", $d)) {
-                $s = str_replace(array("pon","PON"," "),"",$d);
+                $s = str_replace(array("gpon","GPON","pon","PON"," "),"",$d);
                 $s_p = explode("/",trim($s));
-                if(count($s_p) == 2) {
+                if(count($s_p) == 3) {
                     $countPons++;
-                    $s = $s_p[0];
-                    $p = $s_p[1];
+                    $b = $s_p[0];
+                    $s = $s_p[1];
+                    $p = $s_p[2];
                     
-                    $dataCached[$index] = array("ponPort"=>"{$s}/{$p}",'slot'=>$s,'port'=>$p);
+                    $dataCached[$index] = array("ponPort"=>"{$b}/{$s}/{$p}",'board'=>$b,'slot'=>$s,'port'=>$p);
                 }
             } 
         }
@@ -84,7 +85,7 @@ class HuaweiPonScanCommand extends BaseCommand
 
         $fin = microtime(true);
         $time = $fin - $inicio;
-        $this->output->writeln("Tiempo: $time segundos / Cantidad ONUs: {$countPons}");
+        $this->output->writeln("Tiempo: $time segundos / Cantidad Puertos: {$countPons}");
         
     }
 

+ 3 - 3
SNMP/MIBS/OIDSHuaweiV1.php

@@ -18,7 +18,7 @@ class OIDSHuaweiV1 extends \HuaweiBundle\SNMP\MIB {
     const OID_onuPonOpticalVltage                 = "1.3.6.1.4.1.5875.800.3.9.3.3.1.8";
     const OID_onuPonOpticalTemperature            = "1.3.6.1.4.1.5875.800.3.9.3.3.1.10";
     const OID_onuStatus                           = "1.3.6.1.4.1.5875.800.3.10.1.1.11";
-    const OID_oltPonDesc                          = "1.3.6.1.4.1.5875.800.3.9.3.4.1.3";
+    const OID_oltPonDesc                          = "1.3.6.1.2.1.31.1.1.1.1";
     const OID_oltPonEnableStatus                  = "1.3.6.1.4.1.5875.800.3.9.3.4.1.4";
     
     const OID_oltPonRxOpticalPower                = "1.3.6.1.4.1.5875.800.3.9.3.7.1.2";
@@ -34,7 +34,7 @@ class OIDSHuaweiV1 extends \HuaweiBundle\SNMP\MIB {
     const OID_ifInOctets                          = "1.3.6.1.2.1.2.2.1.10";
     const OID_ifOutOctets                         = "1.3.6.1.2.1.2.2.1.16";
     const OID_ifDescr                             = "1.3.6.1.2.1.2.2.1.2";
-    
+        
 
     function convertIndex($index, $values) {
         $data = array();
@@ -105,7 +105,7 @@ class OIDSHuaweiV1 extends \HuaweiBundle\SNMP\MIB {
     
     /* OLT PON */
     public function oltPonDesc($index = null) {
-        return $this->getSNMP()->lastOidWalk(self::OID_oltPonDesc,15);
+        return $this->getSNMP()->lastOidWalk(self::OID_oltPonDesc,12);
     }
 
     public function oltPonEnableStatus($index = null) {