OIDSZTEV1.php 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <?php
  2. namespace ZteBundle\SNMP\MIBS;
  3. // https://ixnfo.com/oid-i-mib-dlya-huawei-olt-i-onu.html
  4. // 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
  5. // https://github.com/chinnurtb/xiaoli/tree/master/node/monitd/include/mib
  6. class OIDSZTEV1 extends \ZteBundle\SNMP\MIB {
  7. const OID_authOnuListSlot = "1.3.6.1.4.1.5875.800.3.10.1.1.2";
  8. const OID_authOnuListPon = "1.3.6.1.4.1.5875.800.3.10.1.1.3";
  9. const OID_authOnuListOnuid = "1.3.6.1.4.1.5875.800.3.10.1.1.4";
  10. const OID_authOnuListMac = "1.3.6.1.4.1.3902.1012.3.28.1.1.5";
  11. const OID_onuPonRxOpticalPower = "1.3.6.1.4.1.3902.1012.3.50.12.1.1.10"; //value * 0.002 - 30
  12. const OID_onuPonTxOpticalPower = "1.3.6.1.4.1.3902.1012.3.50.12.1.1.14"; //value * 0.002 - 30
  13. const OID_onuPonOpticalVltage = "1.3.6.1.4.1.3902.1012.3.50.12.1.1.17"; //(value * 20) / 1000 mV to V
  14. const OID_onuPonOpticalTemperature = "1.3.6.1.4.1.3902.1012.3.50.12.1.1.19"; //(value / 256) C
  15. const OID_onuPonOpticalCurrent = "1.3.6.1.4.1.3902.1012.3.50.12.1.1.18";
  16. const OID_onuCatvRxOpticalPower = "1.3.6.1.4.1.2011.6.128.1.1.2.51.1.7";
  17. /* zxGponPonPowerFeedVoltage OBJECT-TYPE 1.3.6.1.4.1.3902.1012.3.50.12.1.1.17
  18. SYNTAX INTEGER
  19. MAX-ACCESS read-only
  20. STATUS current
  21. DESCRIPTION
  22. "DC voltage, 2s complement, 20 mV resolution.(2 byte)"
  23. REFERENCE
  24. "G.984.4 Section 11.1.10 Test result enumeration"
  25. ::= { zxGponPonEntry 17}
  26. zxGponPonLaserBiasCurrent OBJECT-TYPE 1.3.6.1.4.1.3902.1012.3.50.12.1.1.18
  27. SYNTAX INTEGER
  28. MAX-ACCESS read-only
  29. STATUS current
  30. DESCRIPTION
  31. "2s complement, 2 uA resolution.(2 byte)"
  32. REFERENCE
  33. "G.984.4 Section 11.1.10 Test result enumeration"
  34. ::= { zxGponPonEntry 18}
  35. zxGponPonTemperature OBJECT-TYPE 1.3.6.1.4.1.3902.1012.3.50.12.1.1.19
  36. SYNTAX INTEGER
  37. MAX-ACCESS read-only
  38. STATUS current
  39. DESCRIPTION
  40. "2s complement, 1/256 degree C resolution.(2 byte)"
  41. REFERENCE
  42. "G.984.4 Section 11.1.10 Test result enumeration"
  43. ::= { zxGponPonEntry 19}
  44. ONU O1O7 State O6:Operation-state
  45. 6 - O6, 0 - other
  46. ONU Operational State Online
  47. 1 - LOS, 2 - syncMib, 3 - working, 4 - DyingGasp, x - AuthFail, 6 - OffLine, x - Logging
  48. ONU Last Online Time 2017-02-06 00:14:32
  49. ONU Last Offline Time 0000-00-00 00:00:00
  50. ONU Offline Reason Unknown
  51. 1 - Unknown, 2 - LOS, 3 - LOSi, 7 - LOAMi, 9 - DyingGasp
  52. .1.3.6.1.4.1.3902.1012.3.28.2.1.3.268501248.1=6
  53. .1.3.6.1.4.1.3902.1012.3.28.2.1.4.268501248.1=3
  54. .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"
  55. .1.3.6.1.4.1.3902.1012.3.28.2.1.7.268501248.1=1
  56. */
  57. const OID_onuStatus = "1.3.6.1.4.1.3902.1012.3.28.2.1.4";
  58. const OID_oltPonDesc = "1.3.6.1.2.1.31.1.1.1.1";
  59. const OID_oltPonNexo = "1.3.6.1.4.1.3902.1012.3.13.1.1.1";
  60. const OID_oltPonEnableStatus = "1.3.6.1.4.1.5875.800.3.9.3.4.1.4";
  61. const OID_oltPonRxOpticalPower = "1.3.6.1.4.1.3902.1015.1010.11.2.1.2"; // value * 0.001
  62. const OID_oltPonTxOpticalPower = "1.3.6.1.4.1.3902.1015.3.1.13.1.4"; //value * 0.001
  63. const OID_oltPonOpticalVltage = "1.3.6.1.4.1.3902.1015.3.1.13.1.10"; // value * 0.001
  64. const OID_oltPonOpticalCurrent = "1.3.6.1.4.1.3902.1015.3.1.13.1.9"; // value * 0.001
  65. const OID_oltPonOpticalTemperature = "1.3.6.1.4.1.3902.1015.3.1.13.1.12"; // value * 0.001
  66. //Genericos
  67. const OID_ifHCInOctets = "1.3.6.1.2.1.31.1.1.1.6";
  68. const OID_ifHCOutOctets = "1.3.6.1.2.1.31.1.1.1.10";
  69. const OID_ifInOctets = "1.3.6.1.2.1.2.2.1.10";
  70. const OID_ifOutOctets = "1.3.6.1.2.1.2.2.1.16";
  71. const OID_ifDescr = "1.3.6.1.2.1.2.2.1.2";
  72. const OID_cardCpu = "1.3.6.1.4.1.3902.1015.2.1.1.3.1.9";
  73. const OID_cardMemory = "1.3.6.1.4.1.3902.1015.2.1.1.3.1.11";
  74. function convertIndex($index, $values) {
  75. $data = array();
  76. foreach($values as $i => $v) {
  77. if(isset($index[$i])) {
  78. $data[$index[$i]] = $v;
  79. }
  80. }
  81. if(!empty($index)) return $data;
  82. return $values;
  83. }
  84. public function onuSlot() {
  85. return $this->getSNMP()->lastOidWalk(self::OID_authOnuListSlot,14);
  86. }
  87. public function onuPon() {
  88. return $this->getSNMP()->lastOidWalk(self::OID_authOnuListPon,14);
  89. }
  90. public function onuOnuid() {
  91. return $this->getSNMP()->lastOidWalk(self::OID_authOnuListOnuid,14);
  92. }
  93. public function onuSerialNumber($index = null) {
  94. if(is_null($index)) {
  95. return $this->getSNMP()->lastOidWalk(self::OID_authOnuListMac,14);
  96. }
  97. $values = $this->getSNMP()->lastOidWalk(self::OID_authOnuListMac,14);
  98. return $this->convertIndex($index, $values);
  99. }
  100. public function onuCatvRxOpticalPower($index = null) {
  101. if(is_null($index)) {
  102. return $this->getSNMP()->lastOidWalk(self::OID_onuCatvRxOpticalPower,16);
  103. }
  104. $values = $this->getSNMP()->lastOidWalk(self::OID_onuCatvRxOpticalPower,16);
  105. return $this->convertIndex($index, $values);
  106. }
  107. public function onuPonRxOpticalPower($index = null) {
  108. if(is_null($index)) {
  109. return $this->getSNMP()->lastOidWalk(self::OID_onuPonRxOpticalPower,15);
  110. }
  111. $values = $this->getSNMP()->lastOidWalk(self::OID_onuPonRxOpticalPower,15);
  112. return $this->convertIndex($index, $values);
  113. }
  114. public function onuPonTxOpticalPower($index = null) {
  115. if(is_null($index)) {
  116. return $this->getSNMP()->lastOidWalk(self::OID_onuPonTxOpticalPower,15);
  117. }
  118. $values = $this->getSNMP()->lastOidWalk(self::OID_onuPonTxOpticalPower,15);
  119. return $this->convertIndex($index, $values);
  120. }
  121. public function onuPonOpticalVltage($index = null) {
  122. $values = $this->getSNMP()->lastOidWalk(self::OID_onuPonOpticalVltage,15);
  123. return $this->convertIndex($index, $values);
  124. }
  125. public function onuPonOpticalTemperature($index = null) {
  126. $values = $this->getSNMP()->lastOidWalk(self::OID_onuPonOpticalTemperature,15);
  127. return $this->convertIndex($index, $values);
  128. }
  129. public function onuStatus($index = null) {
  130. $values = $this->getSNMP()->lastOidWalk(self::OID_onuStatus,14);
  131. return $this->convertIndex($index, $values);
  132. }
  133. /* OLT PON */
  134. public function oltPonDesc($index = null) {
  135. return $this->getSNMP()->lastOidWalk(self::OID_oltPonDesc,12);
  136. }
  137. public function oltPonNexo($index = null) {
  138. return $this->getSNMP()->lastOidWalk(self::OID_oltPonNexo,14);
  139. }
  140. public function oltPonEnableStatus($index = null) {
  141. return $this->getSNMP()->lastOidWalk(self::OID_oltPonEnableStatus,15);
  142. // return $this->convertIndex($index, $values);
  143. }
  144. public function oltPonRxOpticalPower($index = null) {
  145. return $this->getSNMP()->lastOidWalk(self::OID_oltPonRxOpticalPower,14);
  146. // return $this->convertIndex($index, $values);
  147. }
  148. public function oltPonTxOpticalPower($index = null) {
  149. return $this->getSNMP()->lastOidWalk(self::OID_oltPonTxOpticalPower,14);
  150. // return $this->convertIndex($index, $values);
  151. }
  152. public function oltPonOpticalVltage($index = null) {
  153. return $this->getSNMP()->lastOidWalk(self::OID_oltPonOpticalVltage,14);
  154. // return $this->convertIndex($index, $values);
  155. }
  156. public function oltPonOpticalCurrent($index = null) {
  157. return $this->getSNMP()->lastOidWalk(self::OID_oltPonOpticalCurrent,14);
  158. // return $this->convertIndex($index, $values);
  159. }
  160. public function oltPonOpticalTemperature($index = null) {
  161. return $this->getSNMP()->lastOidWalk(self::OID_oltPonOpticalTemperature,14);
  162. // return $this->convertIndex($index, $values);
  163. }
  164. public function ifInOctets() {
  165. return $this->getSNMP()->lastOidWalk(self::OID_ifInOctets,11);
  166. }
  167. public function ifOutOctets() {
  168. return $this->getSNMP()->lastOidWalk(self::OID_ifOutOctets,11);
  169. }
  170. public function ifHCInOctets() {
  171. return $this->getSNMP()->lastOidWalk(self::OID_ifHCInOctets,12);
  172. }
  173. public function ifHCOutOctets() {
  174. return $this->getSNMP()->lastOidWalk(self::OID_ifHCOutOctets,12);
  175. }
  176. public function ifDescr() {
  177. return $this->getSNMP()->lastOidWalk(self::OID_ifDescr,11);
  178. }
  179. public function oltCardCpu($index = null) {
  180. return $this->getSNMP()->lastOidWalk(self::OID_cardCpu,15);
  181. }
  182. public function oltCardMemory($index = null) {
  183. return $this->getSNMP()->lastOidWalk(self::OID_cardMemory,15);
  184. }
  185. }