Parcourir la source

Mejora en la consulta a DocsIfCmts.

root il y a 11 ans
Parent
commit
014b33123e
2 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 2 1
      OSS_SNMP/MIBS/DocsIfCmts.php
  2. 1 1
      OSS_SNMP/SNMP.php

+ 2 - 1
OSS_SNMP/MIBS/DocsIfCmts.php

@@ -25,8 +25,9 @@ class DocsIfCmts extends \OSS_SNMP\MIB {
     public function docsQos3ServiceFlowDirection(){
 	try{
 	    $rtr = array();
-            foreach($this->getSNMP()->realWalk(self::OID_docsQos3ServiceFlowDirection) as $k => $v){
+            foreach((array)$this->getSNMP()->realWalk(self::OID_docsQos3ServiceFlowDirection) as $k => $v){
 		$k_prim = preg_split("|\.|",$k);
+		if(!isset($k_prim[15])) break;
 		$rtr[$k_prim[15].".".$k_prim[16]] = $this->getSNMP()->parseSnmpValue($v);
 	    }
 	    return $rtr;

+ 1 - 1
OSS_SNMP/SNMP.php

@@ -161,7 +161,7 @@ class SNMP
      */
     public function realWalk( $oid )
     {
-        return $this->_lastResult = snmp2_real_walk( $this->getHost(), $this->getCommunity(), $oid, $this->getTimeout(), $this->getRetry() );
+        return $this->_lastResult = @snmp2_real_walk( $this->getHost(), $this->getCommunity(), $oid, $this->getTimeout(), $this->getRetry() );
     }