123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- <?php
- namespace OSS_SNMP\MIBS;
- class DocsIfCmts extends \OSS_SNMP\MIB {
- const OID_docsIfCmtsCmStatusMacAddress = "1.3.6.1.2.1.10.127.1.3.3.1.2";
- //const OID_docsIfCmtsCmStatusTable = "1.3.6.1.2.1.10.127.1.3.3";
- const OID_docsIfCmtsCmStatusUpChannelIfIndex = "1.3.6.1.2.1.10.127.1.3.3.1.5";
- const OID_docsIfCmtsCmStatusDownChannelIfIndex = "1.3.6.1.2.1.10.127.1.3.3.1.4";
- const OID_docsIfCmtsCmStatusIpAddress = "1.3.6.1.2.1.10.127.1.3.3.1.3";
- const OID_docsQosCmtsIfIndex = "1.3.6.1.2.1.10.127.7.1.11.1.3";
- const OID_docsIfCmtsCmStatusIndex = "1.3.6.1.2.1.10.127.1.3.3.1.1";
- const OID_docsQosServiceFlowOctets = "1.3.6.1.2.1.10.127.7.1.4.1.2";
- const OID_docsQosServiceFlowDirection = "1.3.6.1.2.1.10.127.7.1.3.1.7";
- const OID_docsIfCmtsCmStatusRxPower = "1.3.6.1.2.1.10.127.1.3.3.1.6";
- const OID_docsIfCmtsCmStatusValue = "1.3.6.1.2.1.10.127.1.3.3.1.9";
- const OID_docsQos3CmtsIfIndex = "1.3.6.1.4.1.4491.2.1.21.1.11.1.3";
- const OID_docsQos3ServiceFlowOctets = "1.3.6.1.4.1.4491.2.1.21.1.4.1.2";
- const OID_docsQos3ServiceFlowDirection = "1.3.6.1.4.1.4491.2.1.21.1.3.1.7";
- const OID_docsIfSigQSignalNoise = "1.3.6.1.2.1.10.127.1.1.4.1.5";
- const OID_docsIfSigQMicroreflections = "1.3.6.1.2.1.10.127.1.1.4.1.6";
- const docsIfCmtsChannelUtilization = "1.3.6.1.2.1.10.127.1.3.9.1.3";
- public function docsQos3ServiceFlowDirection(){
- try{
- $rtr = array();
- foreach($this->getSNMP()->realWalk(self::OID_docsQos3ServiceFlowDirection) as $k => $v){
- $k_prim = preg_split("|\.|",$k);
- $rtr[$k_prim[15].".".$k_prim[16]] = $this->getSNMP()->parseSnmpValue($v);
- }
- return $rtr;
- }catch (\Exception $e){
- echo "ouch!".$e->getMessage()."\n";
- return array();
- }
- }
- public function docsQos3CmtsIfIndex(){
- try{
- $rtr = array();
- foreach($this->getSNMP()->realWalk(self::OID_docsQos3CmtsIfIndex) as $k => $v){
- $k_prim = preg_split("|\.|",$k);
- $k_mac = sprintf("%02x:%02x:%02x:%02x:%02x:%02x",
- $k_prim[15], $k_prim[16], $k_prim[17], $k_prim[18], $k_prim[19], $k_prim[20]);
- $rtr[$k_mac][] = $this->getSNMP()->parseSnmpValue($v). ".".$k_prim[21];
- }
- return $rtr;
- }catch (\Exception $e){
- echo "ouch!".$e->getMessage()."\n";
- return array();
- }
- }
- public function docsQos3ServiceFlowOctets(){
- try{
- $rtr = array();
- foreach($this->getSNMP()->realWalk(self::OID_docsQos3ServiceFlowOctets) as $k => $v){
- $k_prim = preg_split("|\.|",$k);
- $rtr[$k_prim[15].".".$k_prim[16]] = $this->getSNMP()->parseSnmpValue($v);
- }
- return $rtr;
- }catch (\Exception $e){
- echo "ouch! ".$e->getMessage()."\n";
- return array();
- }
- }
- public function docsQosServiceFlowDirection(){
- return $this->getSNMP()->walk1d(self::OID_docsQosServiceFlowDirection);
- }
- public function docsQosCmtsIfIndex(){
- try{
- $rtr = array();
- foreach($this->getSNMP()->realWalk(self::OID_docsQosCmtsIfIndex) as $k => $v){
- $k_prim = preg_split("|\.|",$k);
- $k_mac = sprintf("%02x:%02x:%02x:%02x:%02x:%02x",
- $k_prim[14], $k_prim[15], $k_prim[16], $k_prim[17], $k_prim[18], $k_prim[19]);
- $rtr[$k_mac][] = $k_prim[20]; //$this->getSNMP()->parseSnmpValue($v);
- }
- return $rtr;
- }catch (\Exception $e){
- echo "ouch!".$e->getMessage()."\n";
- return array();
- }
- }
- public function docsQosServiceFlowOctets(){
- 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()
- {
- $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 docsIfCmtsCmStatusDownChannelIfIndex(){
- return $this->getSNMP()->walk1d(self::OID_docsIfCmtsCmStatusDownChannelIfIndex);
- }
- //public function docsIfCmtsCmStatusIpAddress(){
- // return $this->getSNMP()->walk1d(self::OID_docsIfCmtsCmStatusIpAddress);
- //}
- 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(){
- $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);
- }
-
- public function docsIfCmtsChannelUtilization(){
- return $this->getSNMP()->realWalk(self::docsIfCmtsChannelUtilization);
- }
- }
|