Kaynağa Gözat

snmp para cmts

Luciano Andrade 12 yıl önce
ebeveyn
işleme
d2d488ec20
2 değiştirilmiş dosya ile 32 ekleme ve 14 silme
  1. 32 13
      OSS_SNMP/MIBS/DocsIfCmts.php
  2. 0 1
      OSS_SNMP/SNMP.php

+ 32 - 13
OSS_SNMP/MIBS/DocsIfCmts.php

@@ -91,43 +91,62 @@ class DocsIfCmts extends \OSS_SNMP\MIB {
 	return $this->getSNMP()->walk1d(self::OID_docsQosServiceFlowOctets);
     }
 
-
+    /**
+other(1)   Any state other than below.
+ranging(2)   The CMTS has received an Initial Ranging Request   message from the CM, and the ranging process is not  yet   complete.
+rangingAborted(3)   The CMTS has sent a Ranging Abort message to the CM.
+rangingComplete(4)   The CMTS has sent a Ranging Complete message to the CM.
+ipComplete(5)   The CMTS has received a DHCP reply message and forwarded   it to the CM.
+registrationComplete(6)   The CMTS has sent a Registration Response message to the CM.
+accessDenied(7)   The CMTS has sent a Registration Aborted message   to the CM.
+      **/
     public function docsIfCmtsCmStatusMacAddress()
     {
-        return $this->getSNMP()->walk1d(self::OID_docsIfCmtsCmStatusMacAddress);
+        $rtr = $this->getSNMP()->walk1d(self::OID_docsIfCmtsCmStatusMacAddress);
+	return $rtr;
     }
 
     //public function docsIfCmtsCmStatusIndex(){
     //    return $this->getSNMP()->walk1d(self::OID_docsIfCmtsCmStatusDownChannelIfIndex);
     //}
 
-    //public function docsIfCmtsCmStatusUpChannelIfIndex(){
-    //	return $this->getSNMP()->walk1d(self::OID_docsIfCmtsCmStatusUpChannelIfIndex);
-    //}
+    public function docsIfCmtsCmStatusUpChannelIfIndex(){
+    	return $this->getSNMP()->walk1d(self::OID_docsIfCmtsCmStatusUpChannelIfIndex);
+    }
 
-    //public function docsIfCmtsCmStatusDownChannelIfIndex(){
-    //	return $this->getSNMP()->walk1d(self::OID_docsIfCmtsCmStatusDownChannelIfIndex);
-    //}
+    public function docsIfCmtsCmStatusDownChannelIfIndex(){
+    	return $this->getSNMP()->walk1d(self::OID_docsIfCmtsCmStatusDownChannelIfIndex);
+    }
 
     //public function docsIfCmtsCmStatusIpAddress(){
     //    return $this->getSNMP()->walk1d(self::OID_docsIfCmtsCmStatusIpAddress);
     //}
 
 
-    //public function docsIfCmtsCmStatusValue(){	
-    //    return $this->getSNMP()->walk1d(self::OID_docsIfCmtsCmStatusValue);
-    //}
+    public function docsIfCmtsCmStatusValue(){	
+
+        $rtr = $this->getSNMP()->walk1d(self::OID_docsIfCmtsCmStatusValue);
+        $replace = array(1 => 'other' , 2 =>  'ranging', 3 => 'rangingAborted', 4 => 'rangingComplete', 5 => 'ipComplete',
+                        6 => 'registrationComplete', 7 => 'accessDenied');
+        foreach($rtr as $k => $v){ $rtr[$k] = $replace[$v]; }
+	return $rtr;
+        
+    }
 
     public function docsIfCmtsCmStatusRxPower(){
 	return $this->getSNMP()->walk1d(self::OID_docsIfCmtsCmStatusRxPower);
     }
 
     public function docsIfSigQSignalNoise(){
-	return $this->getSNMP()->walk1d(self::OID_docsIfSigQSignalNoise);
+	$rtr = array();
+	foreach($this->getSNMP()->realWalk(self::OID_docsIfSigQSignalNoise) as $oid => $val){
+		sscanf($val,"INTEGER: %f TenthdB", $readval);
+		$rtr[substr($oid,strlen(self::OID_docsIfSigQSignalNoise)+2)] = $readval;
+	}
+	return $rtr;
     }
 
     public function docsIfSigQMicroreflections(){
 	return $this->getSNMP()->walk1d(self::OID_docsIfSigQMicroreflections);
     }
-
 }

+ 0 - 1
OSS_SNMP/SNMP.php

@@ -182,7 +182,6 @@ class SNMP
         if( $this->_lastResult === false )
             throw new Exception( 'Cound not perform walk for OID ' . $oid );
 
-	var_dump($this->_lastResult);
         return $this->getCache()->save( $oid, $this->parseSnmpValue( $this->_lastResult ) );
     }