OIDSFurukawaG8SV1.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <?php
  2. namespace FurukawaBundle\SNMP\MIBS;
  3. class OIDSFurukawaG8SV1 extends \FurukawaBundle\SNMP\MIB {
  4. const OID_authOnuListSlot = "1.3.6.1.4.1.5875.800.3.10.1.1.2";
  5. const OID_authOnuListPon = "1.3.6.1.4.1.5875.800.3.10.1.1.3";
  6. const OID_authOnuListOnuid = "1.3.6.1.4.1.10428.9.1.101.23.3.1.1.1";
  7. // 1.3.6.1.4.1.2011.6.128.1.1.4.42.1.3
  8. const OID_authOnuListMac = "1.3.6.1.4.1.10428.9.1.101.23.3.1.1.11";
  9. const OID_onuPonRxOpticalPower = "1.3.6.1.4.1.10428.101.23.3.1.1.16";
  10. const OID_onuPonTxOpticalPower = "1.3.6.1.4.1.2011.6.128.1.1.2.51.1.3";
  11. const OID_onuPonOpticalVltage = "1.3.6.1.4.1.2011.6.128.1.1.2.51.1.5";
  12. const OID_onuPonOpticalTemperature = "1.3.6.1.4.1.2011.6.128.1.1.2.51.1.1";
  13. const OID_onuPonOpticalCurrent = "1.3.6.1.4.1.2011.6.128.1.1.2.51.1.2";
  14. const OID_onuStatus = "1.3.6.1.4.1.10428.101.23.3.1.1.2";
  15. const OID_oltPonDesc = "1.3.6.1.2.1.31.1.1.1.1";
  16. const OID_oltPonEnableStatus = "1.3.6.1.4.1.5875.800.3.9.3.4.1.4";
  17. const OID_oltPonRxOpticalPower = "1.3.6.1.4.1.10428.101.23.3.1.1.21"; // (value - 10000) * 0.01
  18. const OID_oltPonTxOpticalPower = "1.3.6.1.4.1.2011.6.128.1.1.2.23.1.4";
  19. const OID_oltPonOpticalVltage = "1.3.6.1.4.1.2011.6.128.1.1.2.23.1.2";
  20. const OID_oltPonOpticalCurrent = "1.3.6.1.4.1.2011.6.128.1.1.2.23.1.3";
  21. const OID_oltPonOpticalTemperature = "1.3.6.1.4.1.2011.6.128.1.1.2.23.1.1";
  22. //1.3.6.1.4.1.2011.6.128.1.1.4.42.1.3
  23. //Genericos
  24. const OID_ifHCInOctets = "1.3.6.1.2.1.31.1.1.1.6";
  25. const OID_ifHCOutOctets = "1.3.6.1.2.1.31.1.1.1.10";
  26. const OID_ifInOctets = "1.3.6.1.2.1.2.2.1.10";
  27. const OID_ifOutOctets = "1.3.6.1.2.1.2.2.1.16";
  28. const OID_ifDescr = "1.3.6.1.2.1.2.2.1.2";
  29. const OID_cardCpu = "1.3.6.1.4.1.2011.2.6.7.1.1.2.1.5";
  30. const OID_cardMemory = "1.3.6.1.4.1.2011.2.6.7.1.1.2.1.6";
  31. function convertIndex($index, $values) {
  32. $data = array();
  33. foreach($values as $i => $v) {
  34. if(isset($index[$i])) {
  35. $data[$index[$i]] = $v;
  36. }
  37. }
  38. if(!empty($index)) return $data;
  39. return $values;
  40. }
  41. public function onuSlot() {
  42. return $this->getSNMP()->lastOidWalk(self::OID_authOnuListSlot,14);
  43. }
  44. public function onuPon() {
  45. return $this->getSNMP()->lastOidWalk(self::OID_authOnuListPon,14);
  46. }
  47. public function onuOnuid() {
  48. return $this->getSNMP()->lastOidWalk(self::OID_authOnuListOnuid,14);
  49. }
  50. public function onuSerialNumber($index = null) {
  51. if(is_null($index)) {
  52. return $this->getSNMP()->lastOidWalk(self::OID_authOnuListMac,16);
  53. }
  54. $values = $this->getSNMP()->lastOidWalk(self::OID_authOnuListMac,16);
  55. return $this->convertIndex($index, $values);
  56. }
  57. public function onuPonRxOpticalPower($index = null) {
  58. if(is_null($index)) {
  59. return $this->getSNMP()->lastOidWalk(self::OID_onuPonRxOpticalPower,16);
  60. }
  61. $values = $this->getSNMP()->lastOidWalk(self::OID_onuPonRxOpticalPower,16);
  62. return $this->convertIndex($index, $values);
  63. }
  64. public function onuPonTxOpticalPower($index = null) {
  65. if(is_null($index)) {
  66. return $this->getSNMP()->lastOidWalk(self::OID_onuPonTxOpticalPower,16);
  67. }
  68. $values = $this->getSNMP()->lastOidWalk(self::OID_onuPonTxOpticalPower,16);
  69. return $this->convertIndex($index, $values);
  70. }
  71. public function onuPonOpticalVltage($index = null) {
  72. $values = $this->getSNMP()->lastOidWalk(self::OID_onuPonOpticalVltage,16);
  73. return $this->convertIndex($index, $values);
  74. }
  75. public function onuPonOpticalTemperature($index = null) {
  76. $values = $this->getSNMP()->lastOidWalk(self::OID_onuPonOpticalTemperature,16);
  77. return $this->convertIndex($index, $values);
  78. }
  79. public function onuStatus($index = null) {
  80. $values = $this->getSNMP()->lastOidWalk(self::OID_onuStatus,14);
  81. return $this->convertIndex($index, $values);
  82. }
  83. /* OLT PON */
  84. public function oltPonDesc($index = null) {
  85. return $this->getSNMP()->lastOidWalk(self::OID_oltPonDesc,12);
  86. }
  87. public function oltPonEnableStatus($index = null) {
  88. return $this->getSNMP()->lastOidWalk(self::OID_oltPonEnableStatus,15);
  89. // return $this->convertIndex($index, $values);
  90. }
  91. public function oltPonRxOpticalPower($index = null) {
  92. return $this->getSNMP()->lastOidWalk(self::OID_oltPonRxOpticalPower,16);
  93. // return $this->convertIndex($index, $values);
  94. }
  95. public function oltPonTxOpticalPower($index = null) {
  96. return $this->getSNMP()->lastOidWalk(self::OID_oltPonTxOpticalPower,16);
  97. // return $this->convertIndex($index, $values);
  98. }
  99. public function oltPonOpticalVltage($index = null) {
  100. return $this->getSNMP()->lastOidWalk(self::OID_oltPonOpticalVltage,16);
  101. // return $this->convertIndex($index, $values);
  102. }
  103. public function oltPonOpticalCurrent($index = null) {
  104. return $this->getSNMP()->lastOidWalk(self::OID_oltPonOpticalCurrent,16);
  105. // return $this->convertIndex($index, $values);
  106. }
  107. public function oltPonOpticalTemperature($index = null) {
  108. return $this->getSNMP()->lastOidWalk(self::OID_oltPonOpticalTemperature,16);
  109. // return $this->convertIndex($index, $values);
  110. }
  111. public function ifInOctets() {
  112. return $this->getSNMP()->lastOidWalk(self::OID_ifInOctets,11);
  113. }
  114. public function ifOutOctets() {
  115. return $this->getSNMP()->lastOidWalk(self::OID_ifOutOctets,11);
  116. }
  117. public function ifHCInOctets() {
  118. return $this->getSNMP()->lastOidWalk(self::OID_ifHCInOctets,12);
  119. }
  120. public function ifHCOutOctets() {
  121. return $this->getSNMP()->lastOidWalk(self::OID_ifHCOutOctets,12);
  122. }
  123. public function ifDescr() {
  124. return $this->getSNMP()->lastOidWalk(self::OID_ifDescr,11);
  125. }
  126. public function oltCardCpu($index = null) {
  127. return $this->getSNMP()->lastOidWalk(self::OID_cardCpu,16);
  128. }
  129. public function oltCardMemory($index = null) {
  130. return $this->getSNMP()->lastOidWalk(self::OID_cardMemory,16);
  131. }
  132. }