123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <?php
- namespace HuaweiBundle\SNMP\MIBS;
- // https://ixnfo.com/oid-i-mib-dlya-huawei-olt-i-onu.html
- // https://translate.google.com/translate?hl=en&sl=auto&tl=en&u=https%3A%2F%2Fixnfo.com%2Foid-i-mib-dlya-huawei-olt-i-onu.html
- // https://github.com/chinnurtb/xiaoli/tree/master/node/monitd/include/mib
- class OIDSHuaweiV1 extends \HuaweiBundle\SNMP\MIB {
-
- const OID_authOnuListSlot = "1.3.6.1.4.1.5875.800.3.10.1.1.2";
- const OID_authOnuListPon = "1.3.6.1.4.1.5875.800.3.10.1.1.3";
- const OID_authOnuListOnuid = "1.3.6.1.4.1.5875.800.3.10.1.1.4";
- const OID_authOnuListMac = "1.3.6.1.4.1.2011.6.128.1.1.2.43.1.3";
- const OID_onuPonRxOpticalPower = "1.3.6.1.4.1.5875.800.3.9.3.3.1.6";
- const OID_onuPonTxOpticalPower = "1.3.6.1.4.1.5875.800.3.9.3.3.1.7";
- 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.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";
- const OID_oltPonTxOpticalPower = "1.3.6.1.4.1.5875.800.3.9.3.4.1.8";
- const OID_oltPonOpticalVltage = "1.3.6.1.4.1.5875.800.3.9.3.4.1.9";
- const OID_oltPonOpticalCurrent = "1.3.6.1.4.1.5875.800.3.9.3.4.1.10";
- const OID_oltPonOpticalTemperature = "1.3.6.1.4.1.5875.800.3.9.3.4.1.11";
-
-
- //Genericos
- const OID_ifHCInOctets = "1.3.6.1.2.1.31.1.1.1.6";
- const OID_ifHCOutOctets = "1.3.6.1.2.1.31.1.1.1.10";
- 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();
- foreach($values as $i => $v) {
- if(isset($index[$i])) {
- $data[$index[$i]] = $v;
- }
- }
- if(!empty($index)) return $data;
-
- return $values;
- }
-
- public function onuSlot() {
- return $this->getSNMP()->lastOidWalk(self::OID_authOnuListSlot,14);
- }
- public function onuPon() {
- return $this->getSNMP()->lastOidWalk(self::OID_authOnuListPon,14);
- }
-
- public function onuOnuid() {
- return $this->getSNMP()->lastOidWalk(self::OID_authOnuListOnuid,14);
- }
- public function onuSerialNumber($index = null) {
- if(is_null($index)) {
- return $this->getSNMP()->lastOidWalk(self::OID_authOnuListMac,16);
- }
-
- $values = $this->getSNMP()->lastOidWalk(self::OID_authOnuListMac,14);
- return $this->convertIndex($index, $values);
- }
-
- public function onuPonRxOpticalPower($index = null) {
- if(is_null($index)) {
- return $this->getSNMP()->lastOidWalk(self::OID_onuPonRxOpticalPower,15);
- }
-
- $values = $this->getSNMP()->lastOidWalk(self::OID_onuPonRxOpticalPower,15);
- return $this->convertIndex($index, $values);
-
- }
-
- public function onuPonTxOpticalPower($index = null) {
- if(is_null($index)) {
- return $this->getSNMP()->lastOidWalk(self::OID_onuPonTxOpticalPower,15);
- }
- $values = $this->getSNMP()->lastOidWalk(self::OID_onuPonTxOpticalPower,15);
- return $this->convertIndex($index, $values);
- }
-
- public function onuPonOpticalVltage($index = null) {
- $values = $this->getSNMP()->lastOidWalk(self::OID_onuPonOpticalVltage,15);
- return $this->convertIndex($index, $values);
- }
-
- public function onuPonOpticalTemperature($index = null) {
- $values = $this->getSNMP()->lastOidWalk(self::OID_onuPonOpticalTemperature,15);
- return $this->convertIndex($index, $values);
- }
-
- public function onuStatus($index = null) {
- $values = $this->getSNMP()->lastOidWalk(self::OID_onuStatus,14);
- return $this->convertIndex($index, $values);
- }
-
- /* OLT PON */
- public function oltPonDesc($index = null) {
- return $this->getSNMP()->lastOidWalk(self::OID_oltPonDesc,12);
- }
- public function oltPonEnableStatus($index = null) {
- return $this->getSNMP()->lastOidWalk(self::OID_oltPonEnableStatus,15);
- // return $this->convertIndex($index, $values);
- }
-
- public function oltPonRxOpticalPower($index = null) {
- return $this->getSNMP()->lastOidWalk(self::OID_oltPonRxOpticalPower,15);
- // return $this->convertIndex($index, $values);
- }
-
- public function oltPonTxOpticalPower($index = null) {
- return $this->getSNMP()->lastOidWalk(self::OID_oltPonTxOpticalPower,15);
- // return $this->convertIndex($index, $values);
- }
-
- public function oltPonOpticalVltage($index = null) {
- return $this->getSNMP()->lastOidWalk(self::OID_oltPonOpticalVltage,15);
- // return $this->convertIndex($index, $values);
- }
-
- public function oltPonOpticalCurrent($index = null) {
- return $this->getSNMP()->lastOidWalk(self::OID_oltPonOpticalCurrent,15);
- // return $this->convertIndex($index, $values);
- }
-
- public function oltPonOpticalTemperature($index = null) {
- return $this->getSNMP()->lastOidWalk(self::OID_oltPonOpticalTemperature,15);
- // return $this->convertIndex($index, $values);
- }
-
- public function ifInOctets() {
- return $this->getSNMP()->lastOidWalk(self::OID_ifInOctets,11);
- }
-
- public function ifOutOctets() {
- return $this->getSNMP()->lastOidWalk(self::OID_ifOutOctets,11);
- }
-
- public function ifHCInOctets() {
- return $this->getSNMP()->lastOidWalk(self::OID_ifHCInOctets,12);
- }
-
- public function ifHCOutOctets() {
- return $this->getSNMP()->lastOidWalk(self::OID_ifHCOutOctets,12);
- }
-
- public function ifDescr() {
- return $this->getSNMP()->lastOidWalk(self::OID_ifDescr,11);
- }
- }
|