123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241 |
- <?php
- namespace ZteBundle\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 OIDSZTEV1 extends \ZteBundle\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.3902.1012.3.28.1.1.5";
-
- const OID_onuPonRxOpticalPower = "1.3.6.1.4.1.3902.1012.3.50.12.1.1.10"; //value * 0.002 - 30
- const OID_onuPonTxOpticalPower = "1.3.6.1.4.1.3902.1012.3.50.12.1.1.14"; //value * 0.002 - 30
- const OID_onuPonOpticalVltage = "1.3.6.1.4.1.3902.1012.3.50.12.1.1.17"; //(value * 20) / 1000 mV to V
- const OID_onuPonOpticalTemperature = "1.3.6.1.4.1.3902.1012.3.50.12.1.1.19"; //(value / 256) C
- const OID_onuPonOpticalCurrent = "1.3.6.1.4.1.3902.1012.3.50.12.1.1.18";
- const OID_onuCatvRxOpticalPower = "1.3.6.1.4.1.2011.6.128.1.1.2.51.1.7";
- /* zxGponPonPowerFeedVoltage OBJECT-TYPE 1.3.6.1.4.1.3902.1012.3.50.12.1.1.17
- SYNTAX INTEGER
- MAX-ACCESS read-only
- STATUS current
- DESCRIPTION
- "DC voltage, 2s complement, 20 mV resolution.(2 byte)"
- REFERENCE
- "G.984.4 Section 11.1.10 Test result enumeration"
- ::= { zxGponPonEntry 17}
- zxGponPonLaserBiasCurrent OBJECT-TYPE 1.3.6.1.4.1.3902.1012.3.50.12.1.1.18
- SYNTAX INTEGER
- MAX-ACCESS read-only
- STATUS current
- DESCRIPTION
- "2s complement, 2 uA resolution.(2 byte)"
- REFERENCE
- "G.984.4 Section 11.1.10 Test result enumeration"
- ::= { zxGponPonEntry 18}
- zxGponPonTemperature OBJECT-TYPE 1.3.6.1.4.1.3902.1012.3.50.12.1.1.19
- SYNTAX INTEGER
- MAX-ACCESS read-only
- STATUS current
- DESCRIPTION
- "2s complement, 1/256 degree C resolution.(2 byte)"
- REFERENCE
- "G.984.4 Section 11.1.10 Test result enumeration"
- ::= { zxGponPonEntry 19}
-
- ONU O1O7 State O6:Operation-state
- 6 - O6, 0 - other
-
- ONU Operational State Online
- 1 - LOS, 2 - syncMib, 3 - working, 4 - DyingGasp, x - AuthFail, 6 - OffLine, x - Logging
- ONU Last Online Time 2017-02-06 00:14:32
- ONU Last Offline Time 0000-00-00 00:00:00
- ONU Offline Reason Unknown
- 1 - Unknown, 2 - LOS, 3 - LOSi, 7 - LOAMi, 9 - DyingGasp
- .1.3.6.1.4.1.3902.1012.3.28.2.1.3.268501248.1=6
- .1.3.6.1.4.1.3902.1012.3.28.2.1.4.268501248.1=3
- .1.3.6.1.4.1.3902.1012.3.28.2.1.5.268501248.1="2017-02-06 00:14:32" .1.3.6.1.4.1.3902.1012.3.28.2.1.6.268501248.1="0000-00-0000:00:00"
- .1.3.6.1.4.1.3902.1012.3.28.2.1.7.268501248.1=1
-
-
-
- */
-
- const OID_onuStatus = "1.3.6.1.4.1.3902.1012.3.28.2.1.4";
- const OID_oltPonDesc = "1.3.6.1.2.1.31.1.1.1.1";
- const OID_oltPonNexo = "1.3.6.1.4.1.3902.1012.3.13.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.3902.1015.1010.11.2.1.2"; // value * 0.001
- const OID_oltPonTxOpticalPower = "1.3.6.1.4.1.3902.1015.3.1.13.1.4"; //value * 0.001
-
- const OID_oltPonOpticalVltage = "1.3.6.1.4.1.3902.1015.3.1.13.1.10"; // value * 0.001
- const OID_oltPonOpticalCurrent = "1.3.6.1.4.1.3902.1015.3.1.13.1.9"; // value * 0.001
- const OID_oltPonOpticalTemperature = "1.3.6.1.4.1.3902.1015.3.1.13.1.12"; // value * 0.001
-
-
- //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";
-
- const OID_cardCpu = "1.3.6.1.4.1.3902.1015.2.1.1.3.1.9";
- const OID_cardMemory = "1.3.6.1.4.1.3902.1015.2.1.1.3.1.11";
- 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,14);
- }
-
- $values = $this->getSNMP()->lastOidWalk(self::OID_authOnuListMac,14);
- return $this->convertIndex($index, $values);
- }
-
- public function onuCatvRxOpticalPower($index = null) {
- if(is_null($index)) {
- return $this->getSNMP()->lastOidWalk(self::OID_onuCatvRxOpticalPower,16);
- }
-
- $values = $this->getSNMP()->lastOidWalk(self::OID_onuCatvRxOpticalPower,16);
- 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 oltPonNexo($index = null) {
- return $this->getSNMP()->lastOidWalk(self::OID_oltPonNexo,14);
- }
- 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,14);
- // return $this->convertIndex($index, $values);
- }
-
- public function oltPonTxOpticalPower($index = null) {
- return $this->getSNMP()->lastOidWalk(self::OID_oltPonTxOpticalPower,14);
- // return $this->convertIndex($index, $values);
- }
-
- public function oltPonOpticalVltage($index = null) {
- return $this->getSNMP()->lastOidWalk(self::OID_oltPonOpticalVltage,14);
- // return $this->convertIndex($index, $values);
- }
-
- public function oltPonOpticalCurrent($index = null) {
- return $this->getSNMP()->lastOidWalk(self::OID_oltPonOpticalCurrent,14);
- // return $this->convertIndex($index, $values);
- }
-
- public function oltPonOpticalTemperature($index = null) {
- return $this->getSNMP()->lastOidWalk(self::OID_oltPonOpticalTemperature,14);
- // 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);
- }
- public function oltCardCpu($index = null) {
- return $this->getSNMP()->lastOidWalk(self::OID_cardCpu,15);
- }
-
- public function oltCardMemory($index = null) {
- return $this->getSNMP()->lastOidWalk(self::OID_cardMemory,15);
- }
- }
|