Index: includes/definitions/mibs/qtech.inc.php
===================================================================
--- includes/definitions/mibs/qtech.inc.php	(revision 15417)
+++ includes/definitions/mibs/qtech.inc.php	(working copy)
@@ -12,6 +12,7 @@
 
 // This is another clone of GBN* MIBs with a different Qtech specific Oid tree
 
+
 $mib = 'QTECH-GBNPlatformOAM-MIB';
 $config['mibs'][$mib]['enable'] = 1;
 $config['mibs'][$mib]['identity_num'] = '.1.3.6.1.4.1.27514.1.2.1.1';
@@ -18,14 +19,595 @@
 $config['mibs'][$mib]['mib_dir'] = 'qtech';
 $config['mibs'][$mib]['descr'] = 'QTECH clone of GBNPlatformOAM-MIB';
 
-// QTECH-GBNPlatformOAM-MIB::bootromVersion.0 = STRING: V2.62
-$config['mibs'][$mib]['version'][] = [ 'oid' => 'bootromVersion.0', 'transform' => [ 'action' => 'replace', 'from' => 'V', 'to' => '' ] ];
+// GBNPlatformOAM-MIB::prodSerialNo.0 = STRING: 012200040000xxxxxxxxxxxxxx
+$config['mibs'][$mib]['serial'][] = ['oid' => 'prodSerialNo.0'];
+// GBNPlatformOAM-MIB::productName.0 = STRING: QTECH QSW-2900-24T4 Switch Product
+$config['mibs'][$mib]['hardware'][] = [
+  'oid' => 'productName.0',
+  'transformations' => [
+    ['action' => 'replace', 'from' => ' Product', 'to' => ''],
+    ['action' => 'preg_replace', 'from' => '/^qtech\s(\S+).*/i', 'to' => '$1']
+  ]
+];
 
 // Include unified GBN clone definitions
 include __DIR__ . '/gbn/gbnplatformoam-mib.php';
 
+$mib = 'QTECH-GBNDeviceSwitch-MIB';
+$config['mibs'][$mib]['enable'] = 1;
+$config['mibs'][$mib]['identity_num'] = '.1.3.6.1.4.1.27514.1.2.2.1';
+$config['mibs'][$mib]['mib_dir'] = 'qtech';
+$config['mibs'][$mib]['descr'] = '';
+
+/* part of snmpwalk for QTECH-GBNDeviceSwitch-MIB::portSFPInfoTable | egrep -i \.17\|\.18\|\.20\|\.25\|\.26 from Qtech QSW-9001 with 4 pon ports
+QTECH-GBNDeviceSwitch-MIB::portSFPNumber.17 = INTEGER: 17
+QTECH-GBNDeviceSwitch-MIB::portSFPNumber.18 = INTEGER: 18
+QTECH-GBNDeviceSwitch-MIB::portSFPNumber.20 = INTEGER: 20
+QTECH-GBNDeviceSwitch-MIB::portSFPNumber.25 = INTEGER: 25
+QTECH-GBNDeviceSwitch-MIB::portSFPNumber.26 = INTEGER: 26
+QTECH-GBNDeviceSwitch-MIB::transceiverType.17 = INTEGER: SFP(3)
+QTECH-GBNDeviceSwitch-MIB::transceiverType.18 = INTEGER: SFPNotExist(0)
+QTECH-GBNDeviceSwitch-MIB::transceiverType.20 = INTEGER: SFP(3)
+QTECH-GBNDeviceSwitch-MIB::transceiverType.25 = INTEGER: SFP(3)
+QTECH-GBNDeviceSwitch-MIB::transceiverType.26 = INTEGER: SFPNotExist(0)
+QTECH-GBNDeviceSwitch-MIB::compliance.17 = STRING: BASE-PX
+QTECH-GBNDeviceSwitch-MIB::compliance.18 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::compliance.20 = STRING: 10G BASE-SR
+QTECH-GBNDeviceSwitch-MIB::compliance.25 = STRING: 1000BASE-LX
+QTECH-GBNDeviceSwitch-MIB::compliance.26 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::connectorType.17 = INTEGER: SC(1)
+QTECH-GBNDeviceSwitch-MIB::connectorType.18 = INTEGER: SFPNotExist(0)
+QTECH-GBNDeviceSwitch-MIB::connectorType.20 = INTEGER: SC(1)
+QTECH-GBNDeviceSwitch-MIB::connectorType.25 = INTEGER: SC(1)
+QTECH-GBNDeviceSwitch-MIB::connectorType.26 = INTEGER: SFPNotExist(0)
+QTECH-GBNDeviceSwitch-MIB::waveLength.17 = INTEGER: 210
+QTECH-GBNDeviceSwitch-MIB::waveLength.18 = INTEGER: 0
+QTECH-GBNDeviceSwitch-MIB::waveLength.20 = INTEGER: 210
+QTECH-GBNDeviceSwitch-MIB::waveLength.25 = INTEGER: 14
+QTECH-GBNDeviceSwitch-MIB::waveLength.26 = INTEGER: 0
+QTECH-GBNDeviceSwitch-MIB::transferDistance.17 = INTEGER: 20000
+QTECH-GBNDeviceSwitch-MIB::transferDistance.18 = INTEGER: 0
+QTECH-GBNDeviceSwitch-MIB::transferDistance.20 = INTEGER: 40000
+QTECH-GBNDeviceSwitch-MIB::transferDistance.25 = INTEGER: 20000
+QTECH-GBNDeviceSwitch-MIB::transferDistance.26 = INTEGER: 0
+QTECH-GBNDeviceSwitch-MIB::digitalDiagnosticMonitor.17 = INTEGER: Supported(2)
+QTECH-GBNDeviceSwitch-MIB::digitalDiagnosticMonitor.18 = INTEGER: SFPNotExist(0)
+QTECH-GBNDeviceSwitch-MIB::digitalDiagnosticMonitor.20 = INTEGER: Supported(2)
+QTECH-GBNDeviceSwitch-MIB::digitalDiagnosticMonitor.25 = INTEGER: NotSupported(1)
+QTECH-GBNDeviceSwitch-MIB::digitalDiagnosticMonitor.26 = INTEGER: SFPNotExist(0)
+QTECH-GBNDeviceSwitch-MIB::vendorName.17 = STRING: QTECH           
+QTECH-GBNDeviceSwitch-MIB::vendorName.18 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::vendorName.20 = STRING: WTD             
+QTECH-GBNDeviceSwitch-MIB::vendorName.25 = STRING: UpNet           
+QTECH-GBNDeviceSwitch-MIB::vendorName.26 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::manuSerialNumber.17 = STRING: A1861173100001  
+QTECH-GBNDeviceSwitch-MIB::manuSerialNumber.18 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::manuSerialNumber.20 = STRING: BP161101390971  
+QTECH-GBNDeviceSwitch-MIB::manuSerialNumber.25 = STRING: PG4P450178      
+QTECH-GBNDeviceSwitch-MIB::manuSerialNumber.26 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::manufacturingDate.17 = STRING: 2017-08-10
+QTECH-GBNDeviceSwitch-MIB::manufacturingDate.18 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::manufacturingDate.20 = STRING: 2016-03-12
+QTECH-GBNDeviceSwitch-MIB::manufacturingDate.25 = STRING: 2013-10-21
+QTECH-GBNDeviceSwitch-MIB::manufacturingDate.26 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::temperature.17 = INTEGER: 26
+QTECH-GBNDeviceSwitch-MIB::temperature.18 = INTEGER: 0
+QTECH-GBNDeviceSwitch-MIB::temperature.20 = INTEGER: 30
+QTECH-GBNDeviceSwitch-MIB::temperature.25 = INTEGER: 0
+QTECH-GBNDeviceSwitch-MIB::temperature.26 = INTEGER: 0
+QTECH-GBNDeviceSwitch-MIB::voltage.17 = STRING: 3.3970
+QTECH-GBNDeviceSwitch-MIB::voltage.18 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::voltage.20 = STRING: 3.3229
+QTECH-GBNDeviceSwitch-MIB::voltage.25 = STRING: SFPNotSupportedDDM
+QTECH-GBNDeviceSwitch-MIB::voltage.26 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::biasCurrent.17 = STRING: 11.31
+QTECH-GBNDeviceSwitch-MIB::biasCurrent.18 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::biasCurrent.20 = STRING: 7.481
+QTECH-GBNDeviceSwitch-MIB::biasCurrent.25 = STRING: SFPNotSupportedDDM
+QTECH-GBNDeviceSwitch-MIB::biasCurrent.26 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::biasHighThreshold.17 = STRING: 50.00
+QTECH-GBNDeviceSwitch-MIB::biasHighThreshold.18 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::biasHighThreshold.20 = STRING: 70.00
+QTECH-GBNDeviceSwitch-MIB::biasHighThreshold.25 = STRING: SFPNotSupportedDDM
+QTECH-GBNDeviceSwitch-MIB::biasHighThreshold.26 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::biasLowThreshold.17 = STRING: 4.00
+QTECH-GBNDeviceSwitch-MIB::biasLowThreshold.18 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::biasLowThreshold.20 = STRING: 0.00
+QTECH-GBNDeviceSwitch-MIB::biasLowThreshold.25 = STRING: SFPNotSupportedDDM
+QTECH-GBNDeviceSwitch-MIB::biasLowThreshold.26 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::rxPower.17 = STRING: 0.00
+QTECH-GBNDeviceSwitch-MIB::rxPower.18 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::rxPower.20 = STRING: 0.00
+QTECH-GBNDeviceSwitch-MIB::rxPower.25 = STRING: SFPNotSupportedDDM
+QTECH-GBNDeviceSwitch-MIB::rxPower.26 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::rxPowerHighThreshold.17 = STRING: -6.00
+QTECH-GBNDeviceSwitch-MIB::rxPowerHighThreshold.18 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::rxPowerHighThreshold.20 = STRING: -8.00
+QTECH-GBNDeviceSwitch-MIB::rxPowerHighThreshold.25 = STRING: SFPNotSupportedDDM
+QTECH-GBNDeviceSwitch-MIB::rxPowerHighThreshold.26 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::rxPowerLowThreshold.17 = STRING: -30.00
+QTECH-GBNDeviceSwitch-MIB::rxPowerLowThreshold.18 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::rxPowerLowThreshold.20 = STRING: -30.00
+QTECH-GBNDeviceSwitch-MIB::rxPowerLowThreshold.25 = STRING: SFPNotSupportedDDM
+QTECH-GBNDeviceSwitch-MIB::rxPowerLowThreshold.26 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::txPower.17 = STRING: 4.30
+QTECH-GBNDeviceSwitch-MIB::txPower.18 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::txPower.20 = STRING: 3.60
+QTECH-GBNDeviceSwitch-MIB::txPower.25 = STRING: SFPNotSupportedDDM
+QTECH-GBNDeviceSwitch-MIB::txPower.26 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::txPowerHighThreshold.17 = STRING: 7.00
+QTECH-GBNDeviceSwitch-MIB::txPowerHighThreshold.18 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::txPowerHighThreshold.20 = STRING: 5.00
+QTECH-GBNDeviceSwitch-MIB::txPowerHighThreshold.25 = STRING: SFPNotSupportedDDM
+QTECH-GBNDeviceSwitch-MIB::txPowerHighThreshold.26 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::txPowerLowThreshold.17 = STRING: 1.90
+QTECH-GBNDeviceSwitch-MIB::txPowerLowThreshold.18 = STRING: SFPNotExist
+QTECH-GBNDeviceSwitch-MIB::txPowerLowThreshold.20 = STRING: 0.90
+QTECH-GBNDeviceSwitch-MIB::txPowerLowThreshold.25 = STRING: SFPNotSupportedDDM
+QTECH-GBNDeviceSwitch-MIB::txPowerLowThreshold.26 = STRING: SFPNotExist
+
+// Same device - output from CLI (Qtech QSW-9001)
+GEPON_BEL_VO#show interface sfp 
+
+Port p0/1 : // ifIndex=17 - it is PON port
+Common information:
+  Transceiver Type              :SFP
+  Compliance                    :BASE-PX
+  Connector Type                :SC
+  WaveLength(nm)                :1490
+  Transfer Distance(m)          :20000(9um)
+  Digital Diagnostic Monitoring :YES
+  VendorName                    :QTECH           
+Manufacture information:
+  Manu. Serial Number           :A1861173100001 
+  Manufacturing Date            :2017-08-10
+  VendorName                    :QTECH           
+Diagnostic information:
+  Temperature(Celsius)          :25
+  Voltage(V)                    :3.3921
+  Bias Current(mA)              :11.31
+  Bias High Threshold(mA)       :50.00
+  Bias Low  Threshold(mA)       :4.00
+  RX Power(dBm)                 :No optical power
+  RX Power High Threshold(dBm)  :-6.00
+  RX Power Low  Threshold(dBm)  :-30.00
+  TX Power(dBm)                 :4.30
+  TX Power High Threshold(dBm)  :7.00
+  TX Power Low  Threshold(dBm)  :1.90
+
+Port p0/2 : //ifIndex=18 - it is PON port
+Transceiver does not exist!
+
+Port p0/4 : //ifIndex=20 - it is PON port
+Common information:
+  Transceiver Type              :SFP
+  Compliance                    10G BASE-SR
+  Connector Type                :SC
+  WaveLength(nm)                :1490
+  Transfer Distance(m)          :40000(9um)
+  Digital Diagnostic Monitoring :YES
+  VendorName                    :WTD             
+Manufacture information:
+  Manu. Serial Number           :BP161101390971 
+  Manufacturing Date            :2016-03-12
+  VendorName                    :WTD             
+Diagnostic information:
+  Temperature(Celsius)          :29
+  Voltage(V)                    :3.3229
+  Bias Current(mA)              :7.449
+  Bias High Threshold(mA)       :70.00
+  Bias Low  Threshold(mA)       :0.00
+  RX Power(dBm)                 :No optical power
+  RX Power High Threshold(dBm)  :-8.00
+  RX Power Low  Threshold(dBm)  :-30.00
+  TX Power(dBm)                 :3.80
+  TX Power High Threshold(dBm)  :5.00
+  TX Power Low  Threshold(dBm)  :0.90
+
+Port e1/1 : //ifIndex=25 - it is Ethernet port
+Common information:
+  Transceiver Type              :SFP
+  Compliance                    :1000BASE-LX
+  Connector Type                :SC
+  WaveLength(nm)                :1550
+  Transfer Distance(m)          :20000(9um)
+  Digital Diagnostic Monitoring :NO
+  VendorName                    :UpNet           
+Manufacture information:
+  Manu. Serial Number           :PG4P450178     
+  Manufacturing Date            :2013-10-21
+  VendorName                    :UpNet           
+Diagnostic information:
+ Not supported DDM
+*/
+
+$config['mibs'][$mib]['sensor'][] = [
+  'table'          => 'portSFPInfoTable',
+  'class'          => 'temperature',
+  'measured'       => 'port',
+  'measured_match' => [ 'entity_type' => 'port', 'field' => 'ifIndex', 'match' => '%index%' ],
+  'descr'          => '%port_label% Temperature',
+  'oid'            => 'temperature',
+  'test'           => [ 'field' => 'transceiverType', 'operator' => 'ne', 'value' => 'SFPNotExist' ]
+];
+
+$config['mibs'][$mib]['sensor'][] = [
+  'table'          => 'portSFPInfoTable',
+  'class'          => 'current',
+  'measured'       => 'port',
+  'measured_match' => [ 'entity_type' => 'port', 'field' => 'ifIndex', 'match' => '%index%' ],
+  'descr'          => '%port_label% Bias',
+  'oid'            => 'biasCurrent',
+  'oid_limit_low'  => 'biasLowThreshold',
+  'oid_limit_high' => 'biasHighThreshold',
+  'scale'          => 0.001,
+  'limit_scale'    => 0.001,
+  'test'           => [ 'field' => 'transceiverType', 'operator' => 'ne', 'value' => 'SFPNotExist' ]
+];
+
+$config['mibs'][$mib]['sensor'][] = [
+  'table'          => 'portSFPInfoTable',
+  'class'          => 'dbm',
+  'measured'       => 'port',
+  'measured_match' => [ 'entity_type' => 'port', 'field' => 'ifIndex', 'match' => '%index%' ],
+  'descr'          => '%port_label% TX Power',
+  'oid'            => 'txPower',
+  'oid_limit_low'  => 'txPowerLowThreshold',
+  'oid_limit_high' => 'txPowerHighThreshold',
+  'test'           => [ 'field' => 'transceiverType', 'operator' => 'ne', 'value' => 'SFPNotExist' ]
+];
+
+$config['mibs'][$mib]['sensor'][] = [
+  'table'          => 'portSFPInfoTable',
+  'class'          => 'dbm',
+  'measured'       => 'port',
+  'measured_match' => [ 'entity_type' => 'port', 'field' => 'ifIndex', 'match' => '%index%' ],
+  'descr'          => '%port_label% RX Power',
+  'oid'            => 'rxPower',
+  'oid_limit_low'  => 'rxPowerLowThreshold',
+  'oid_limit_high' => 'rxPowerHighThreshold',
+  'invalid'        => 0,
+  'test'           => [ 'field' => 'transceiverType', 'operator' => 'ne', 'value' => 'SFPNotExist' ]
+];
+
+$mib = 'EPON-PON-CONFIG-MIB';
+$config['mibs'][$mib]['enable'] = 1;
+$config['mibs'][$mib]['mib_dir'] = 'qtech';
+$config['mibs'][$mib]['descr'] = 'QTECH MIB for EPON devices like QSW-9001';
+
+/* snmpwalk for EPON-PON-CONFIG-MIB::eponPonOpmTable from Qtech QSW-9001 with 4 pon ports
+EPON-PON-CONFIG-MIB::eponPonOpmCardIndex.0.1 = INTEGER: 0
+EPON-PON-CONFIG-MIB::eponPonOpmCardIndex.0.2 = INTEGER: 0
+EPON-PON-CONFIG-MIB::eponPonOpmCardIndex.0.3 = INTEGER: 0
+EPON-PON-CONFIG-MIB::eponPonOpmCardIndex.0.4 = INTEGER: 0
+EPON-PON-CONFIG-MIB::eponPonOpmPortIndex.0.1 = INTEGER: 1
+EPON-PON-CONFIG-MIB::eponPonOpmPortIndex.0.2 = INTEGER: 2
+EPON-PON-CONFIG-MIB::eponPonOpmPortIndex.0.3 = INTEGER: 3
+EPON-PON-CONFIG-MIB::eponPonOpmPortIndex.0.4 = INTEGER: 4
+EPON-PON-CONFIG-MIB::eponPonOpmTemperature.0.1 = STRING: "26"
+EPON-PON-CONFIG-MIB::eponPonOpmTemperature.0.2 = STRING: "0"
+EPON-PON-CONFIG-MIB::eponPonOpmTemperature.0.3 = STRING: "0"
+EPON-PON-CONFIG-MIB::eponPonOpmTemperature.0.4 = STRING: "30"
+EPON-PON-CONFIG-MIB::eponPonOpmVcc.0.1 = STRING: "3.40"
+EPON-PON-CONFIG-MIB::eponPonOpmVcc.0.2 = STRING: "0.0"
+EPON-PON-CONFIG-MIB::eponPonOpmVcc.0.3 = STRING: "0.0"
+EPON-PON-CONFIG-MIB::eponPonOpmVcc.0.4 = STRING: "3.32"
+EPON-PON-CONFIG-MIB::eponPonOpmBias.0.1 = STRING: "11.6"
+EPON-PON-CONFIG-MIB::eponPonOpmBias.0.2 = STRING: "0.0"
+EPON-PON-CONFIG-MIB::eponPonOpmBias.0.3 = STRING: "0.0"
+EPON-PON-CONFIG-MIB::eponPonOpmBias.0.4 = STRING: "8.8"
+EPON-PON-CONFIG-MIB::eponPonOpmTXPower.0.1 = STRING: "4.20"
+EPON-PON-CONFIG-MIB::eponPonOpmTXPower.0.2 = STRING: "-32.0"
+EPON-PON-CONFIG-MIB::eponPonOpmTXPower.0.3 = STRING: "-32.0"
+EPON-PON-CONFIG-MIB::eponPonOpmTXPower.0.4 = STRING: "3.70"
+EPON-PON-CONFIG-MIB::eponPonOpmRxPower.0.1 = STRING: "-32.0"
+EPON-PON-CONFIG-MIB::eponPonOpmRxPower.0.2 = STRING: "-32.0"
+EPON-PON-CONFIG-MIB::eponPonOpmRxPower.0.3 = STRING: "-32.0"
+EPON-PON-CONFIG-MIB::eponPonOpmRxPower.0.4 = STRING: "-32.0"
+EPON-PON-CONFIG-MIB::eponPonOpmRefresh.0.1 = INTEGER: 0
+EPON-PON-CONFIG-MIB::eponPonOpmRefresh.0.2 = INTEGER: 0
+EPON-PON-CONFIG-MIB::eponPonOpmRefresh.0.3 = INTEGER: 0
+EPON-PON-CONFIG-MIB::eponPonOpmRefresh.0.4 = INTEGER: 0
+
+*/
+// index 0.1 -> for port p0/1
+// in EPON-ONU-CONFIG-MIB values in eponOnuOpmVcc,eponOnuOpmBias,eponOnuOpmTXPower,eponOnuOpmRxPower must be in centi-V, centi-mA, centi-mw, centi-mw (scales: 0.01, 0.00001, 0.01, 0.01)
+// it is correct for software V100R001B01D001P005SP12
+// but on software V100R001B01D001P006SP10 and V100R001B01D001P007SP1 this values is in V, mA, mw, mw
+$config['mibs'][$mib]['sensor'][] = [
+  'table'          => 'eponPonOpmTable',
+  'class'          => 'temperature',
+  'measured'       => 'port',
+  'measured_match' => [ 'entity_type' => 'port', 'field' => 'ifName', 'match' => 'p%eponPonOpmCardIndex%/%eponPonOpmPortIndex%' ],
+  'descr'          => '%port_label% Temperature PON',
+  'oid'            => 'eponPonOpmTemperature',
+  'invalid'        => 0,
+  //'oid_num'  => '.1.3.6.1.4.1.40418.7.100.1.11.9'
+];
+
+$config['mibs'][$mib]['sensor'][] = [
+  'table'          => 'eponPonOpmTable',
+  'class'          => 'current',
+  'measured'       => 'port',
+  'measured_match' => [ 'entity_type' => 'port', 'field' => 'ifName', 'match' => 'p%eponPonOpmCardIndex%/%eponPonOpmPortIndex%' ],
+  'descr'          => '%port_label% Bias PON',
+  'oid'            => 'eponPonOpmBias',
+  'scale'          => 0.001,
+  'limit_scale'    => 0.001,
+  'invalid'        => 0
+];
+
+$config['mibs'][$mib]['sensor'][] = [
+  'table'          => 'eponPonOpmTable',
+  'class'          => 'dbm',
+  'measured'       => 'port',
+  'measured_match' => [ 'entity_type' => 'port', 'field' => 'ifName', 'match' => 'p%eponPonOpmCardIndex%/%eponPonOpmPortIndex%' ],
+  'descr'          => '%port_label% TX Power PON',
+  'oid'            => 'eponPonOpmTXPower',
+  //'oid_num'        => '.1.3.6.1.4.1.6339.100.30.1.1.22',
+  'scale'          => 1,
+  'limit_low'      => -32,
+  'invalid'        => -32
+];
+
+$config['mibs'][$mib]['sensor'][] = [
+  'table'          => 'eponPonOpmTable',
+  'class'          => 'dbm',
+  'measured'       => 'port',
+  'measured_match' => [ 'entity_type' => 'port', 'field' => 'ifName', 'match' => 'p%eponPonOpmCardIndex%/%eponPonOpmPortIndex%' ],
+  'descr'          => '%port_label% RX Power PON',
+  'oid'            => 'eponPonOpmRxPower',
+  //'oid_num'        => '.1.3.6.1.4.1.6339.100.30.1.1.17',
+  'scale'          => 1,
+  'limit_low'      => -32,
+  'invalid'        => -32
+];
+
+/*unused
+$mib = 'EPON-OLT-CONFIG-MIB';
+$config['mibs'][$mib]['enable'] = 1;
+$config['mibs'][$mib]['mib_dir'] = 'qtech';
+$config['mibs'][$mib]['descr'] = 'QTECH OLT config MIB';
+
+//EPON-OLT-CONFIG-MIB ветка .1.3.6.1.4.1.27514.1.13.1
+//eponOltName.1 = EPON OLT
+//eponOltType.1 = QSW-9001
+//eponOltDeviceUpTime.1 = 10:17:34:33.17
+//eponOltDeviceStyle.1 = fixed
+//eponBoardIndex.0 = 0
+//eponBoardState.0 = up
+//eponBoardConfigType.0 = 0
+//eponBoardTrueType.0 = 0
+//eponBoardSwVersion.0 = "QSW-9001 V100R001B01D001P006SP10"
+//eponBoardHwVersion.0 = "V1.0"
+//eponBoardReset.0 = 1
+//eponChannelNum.1 = 1024
+//eponLiveTime.1 = 300
+//eponPreviewTimes.1 = 5
+//eponPreviewInterTime.1 = 300
+//eponPreviewOnceTime.1 = 180
+//eponPrevieResetTime.1 = 3600
+*/
+
+$mib = 'EPON-ONU-CONFIG-MIB';
+$config['mibs'][$mib]['enable'] = 1;
+$config['mibs'][$mib]['mib_dir'] = 'qtech';
+$config['mibs'][$mib]['descr'] = 'QTECH ONU config MIB';
+
+//EPON-ONU-CONFIG-MIB::eponOnuInfoTable
+//eponOnuOperationStatus.0.1.1 = down
+//eponOnuOperationStatus.0.1.2 = up
+//eponOnuOperationStatus.0.1.3 = up
+//eponOnuOperationStatus.0.1.4 = up
+//eponOnuOperationStatus.0.1.5 = up
+//eponOnuName.0.1.1 = epon
+//eponOnuName.0.1.2 = epon
+//eponOnuName.0.1.3 = epon
+//eponOnuName.0.1.4 = epon
+//eponOnuName.0.1.5 = epon
+//eponOnuLlid.0.1.1 = 0
+//eponOnuLlid.0.1.2 = 1
+//eponOnuLlid.0.1.3 = 7
+//eponOnuLlid.0.1.4 = 2
+//eponOnuLlid.0.1.5 = 11
+//eponOnuVendor.0.1.1 = ""
+//eponOnuVendor.0.1.2 = "SNR"
+//eponOnuVendor.0.1.3 = "QTEC"
+//eponOnuVendor.0.1.4 = "QTEC"
+//eponOnuVendor.0.1.5 = "SNR"
+//eponOnuModel.0.1.1 = ""
+//eponOnuModel.0.1.2 = "SE1G"
+//eponOnuModel.0.1.3 = "QENT"
+//eponOnuModel.0.1.4 = "QENT"
+//eponOnuModel.0.1.5 = "SE1G"
+//eponOnuId.0.1.1 = 8:c6:b3:b5:94:ee
+//eponOnuId.0.1.2 = f8:f0:82:17:c0:94
+//eponOnuId.0.1.3 = 8:c6:b3:b5:60:90
+//eponOnuId.0.1.4 = 8:c6:b3:b5:74:ee
+//eponOnuId.0.1.5 = f8:f0:82:15:5:ce
+//eponOnuSoftVersion.0.1.1 = ""
+//eponOnuSoftVersion.0.1.2 = "V2.1.5"
+//eponOnuSoftVersion.0.1.3 = "V2.1.3"
+//eponOnuSoftVersion.0.1.4 = "V2.1.3"
+//eponOnuSoftVersion.0.1.5 = "V2.1.2"
+//eponOnuSoftVersion.0.1.6 = "V2.1.5"
+//eponOnuHwVersion.0.1.1 = ""
+//eponOnuHwVersion.0.1.2 = "HZ670.2A"
+//eponOnuHwVersion.0.1.3 = "HZ660.2A"
+//eponOnuHwVersion.0.1.4 = "HZ660.2A"
+//eponOnuHwVersion.0.1.5 = "HZ650.1A"
+//eponOnuchipVendor.0.1.1 = ""
+//eponOnuchipVendor.0.1.2 = "03 8C "
+//eponOnuchipVendor.0.1.3 = "03 8C "
+//eponOnuchipVendor.0.1.4 = "03 8C "
+//eponOnuchipVendor.0.1.5 = "03 8C "
+//eponOnuchipModel.0.1.1 = ""
+//eponOnuchipModel.0.1.2 = "91 25 "
+//eponOnuchipModel.0.1.3 = "91 25 "
+//eponOnuchipModel.0.1.4 = "91 25 "
+//eponOnuchipModel.0.1.5 = "91 25 "
+//eponOnuchipRev.0.1.1 = "00 "
+//eponOnuchipRev.0.1.2 = "("
+//eponOnuchipRev.0.1.3 = "("
+//eponOnuchipRev.0.1.4 = "("
+//eponOnuchipRev.0.1.5 = "("
+//eponOnuchipIc.0.1.1 = ""
+//eponOnuchipIc.0.1.2 = "16 06 14 "
+//eponOnuchipIc.0.1.3 = "16 06 14 "
+//eponOnuchipIc.0.1.4 = "16 06 14 "
+//eponOnuchipIc.0.1.5 = "16 06 14 "
+//eponOnuFirmWare.0.1.1 = ""
+//eponOnuFirmWare.0.1.2 = "01 01 01 "
+//eponOnuFirmWare.0.1.3 = "01 01 01 "
+//eponOnuFirmWare.0.1.4 = "01 01 01 "
+//eponOnuFirmWare.0.1.5 = "01 01 01 "
+//eponOnuReset.0.1.1 = 1
+//eponOnuReset.0.1.2 = 1
+//eponOnuReset.0.1.3 = 1
+//eponOnuReset.0.1.4 = 1
+//eponOnuReset.0.1.5 = 1
+//eponOnuTestDistance.0.1.1 = 0
+//eponOnuTestDistance.0.1.2 = 529
+//eponOnuTestDistance.0.1.3 = 512
+//eponOnuTestDistance.0.1.4 = 956
+//eponOnuTestDistance.0.1.5 = 262
+//eponOnuRegTime.0.1.1 = "-"
+//eponOnuRegTime.0.1.2 = "02/05/01 09:11:50"
+//eponOnuRegTime.0.1.3 = "02/04/24 18:47:30"
+//eponOnuRegTime.0.1.4 = "02/04/24 18:47:26"
+//eponOnuRegTime.0.1.5 = "02/04/26 07:03:59"
+//eponOnuFecMode.0.1.1 = disable
+//eponOnuFecMode.0.1.2 = disable
+//eponOnuFecMode.0.1.3 = disable
+//eponOnuFecMode.0.1.4 = disable
+//eponOnuFecMode.0.1.5 = disable
+//eponOnuUpgrade.0.1.1 = 1
+//eponOnuUpgrade.0.1.2 = 1
+//eponOnuUpgrade.0.1.3 = 1
+//eponOnuUpgrade.0.1.4 = 1
+//eponOnuUpgrade.0.1.5 = 1
+//eponOnuUpgradeCommit.0.1.1 = 1
+//eponOnuUpgradeCommit.0.1.2 = 1
+//eponOnuUpgradeCommit.0.1.3 = 1
+//eponOnuUpgradeCommit.0.1.4 = 1
+//eponOnuUpgradeCommit.0.1.5 = 1
+
+
+$config['mibs'][$mib]['sensor'][] = [
+  'table'          => 'eponOnuInfoTable',
+  'class'          => 'distance',
+  'measured'       => 'port',
+  'measured_match' => [ 'entity_type' => 'port', 'field' => 'ifName', 'match' => 'p%eponOnuInfoCardIndex%/%eponOnuInfoPonIndex%' ],
+  'descr'          => 'EPON ONU %eponOnuVendor% Test Distance %eponOnuInfoOnuIndex%',
+  'oid'            => 'eponOnuTestDistance',
+  'invalid'        => 0,
+  //'oid_num'        => '.1.3.6.1.4.1.40418.7.100.1.11.9'
+];
+
+$type = 'eponOnuOperationStatus';
+$config['mibs'][$mib]['states'][$type][0] = array('name' => 'down', 'event' => 'warning');
+$config['mibs'][$mib]['states'][$type][1] = array('name' => 'up',   'event' => 'ok');
+
+$config['mibs'][$mib]['status'][] = [
+  'table'        => 'eponOnuInfoTable',
+  'measured'     => 'port',
+  'type'         => 'eponOnuOperationStatus',
+  'descr'        => 'EPON ONU %eponOnuVendor% status %index%',
+  'oid'          => 'eponOnuOperationStatus',
+//  'oid_num'      => '.1.3.6.1.4.1.40418.7.100.1.23.1.2',
+];
+
+//EPON-ONU-CONFIG-MIB::eponOnuOpmTable
+//eponOnuOpmCardIndex.0.1.2 = 0
+//eponOnuOpmCardIndex.0.1.3 = 0
+//eponOnuOpmCardIndex.0.1.4 = 0
+//eponOnuOpmCardIndex.0.1.5 = 0
+//eponOnuOpmPonIndex.0.1.2 = 1
+//eponOnuOpmPonIndex.0.1.3 = 1
+//eponOnuOpmPonIndex.0.1.4 = 1
+//eponOnuOpmPonIndex.0.1.5 = 1
+//eponOnuOpmOnuIndex.0.1.2 = 2
+//eponOnuOpmOnuIndex.0.1.3 = 3
+//eponOnuOpmOnuIndex.0.1.4 = 4
+//eponOnuOpmOnuIndex.0.1.5 = 5
+//eponOnuOpmTemperature.0.1.2 = "35"
+//eponOnuOpmTemperature.0.1.3 = "32"
+//eponOnuOpmTemperature.0.1.4 = "32"
+//eponOnuOpmTemperature.0.1.5 = "12"
+//eponOnuOpmVcc.0.1.2 = "3.31"
+//eponOnuOpmVcc.0.1.3 = "3.36"
+//eponOnuOpmVcc.0.1.4 = "3.32"
+//eponOnuOpmVcc.0.1.5 = "3.29"
+//eponOnuOpmBias.0.1.2 = "7.70"
+//eponOnuOpmBias.0.1.3 = "14.90"
+//eponOnuOpmBias.0.1.4 = "15.60"
+//eponOnuOpmBias.0.1.5 = "7.20"
+//eponOnuOpmTXPower.0.1.2 = "1.70"
+//eponOnuOpmTXPower.0.1.3 = "1.80"
+//eponOnuOpmTXPower.0.1.4 = "1.80"
+//eponOnuOpmTXPower.0.1.5 = "2.10"
+//eponOnuOpmRxPower.0.1.2 = "-15.90"
+//eponOnuOpmRxPower.0.1.3 = "-19.20"
+//eponOnuOpmRxPower.0.1.4 = "-26.0"
+//eponOnuOpmRxPower.0.1.5 = "-15.90"
+//eponOnuOpmRefresh.0.1.2 = 0
+//eponOnuOpmRefresh.0.1.3 = 0
+//eponOnuOpmRefresh.0.1.4 = 0
+//eponOnuOpmRefresh.0.1.5 = 0
+
+// index x.y.z -> for port px/y
+$config['mibs'][$mib]['sensor'][] = [
+  'table'          => 'eponOnuOpmTable',
+  'class'          => 'temperature',
+  'measured'       => 'port',
+  'measured_match' => [ 'entity_type' => 'port', 'field' => 'ifName', 'match' => 'p%eponOnuOpmCardIndex%/%eponOnuOpmPonIndex%' ],
+  'descr'          => 'Temperature ONU %eponOnuOpmOnuIndex%',
+  'oid'            => 'eponOnuOpmTemperature',
+  //'oid_num'        => '.1.3.6.1.4.1.40418.7.100.1.11.9'
+  'invalid'        => 0,
+];
+
+$config['mibs'][$mib]['sensor'][] = [
+  'table'          => 'eponOnuOpmTable',
+  'class'          => 'current',
+  'measured'       => 'port',
+  'measured_match' => [ 'entity_type' => 'port', 'field' => 'ifName', 'match' => 'p%eponOnuOpmCardIndex%/%eponOnuOpmPonIndex%' ],
+  'descr'          => 'Bias ONU %eponOnuOpmOnuIndex%',
+  'oid'            => 'eponOnuOpmBias',
+//  'scale'          => 0.001,
+//  'limit_scale'    => 0.001,
+];
+
+$config['mibs'][$mib]['sensor'][] = [
+  'table'          => 'eponOnuOpmTable',
+  'class'          => 'dbm',
+  'measured'       => 'port',
+  'measured_match' => [ 'entity_type' => 'port', 'field' => 'ifName', 'match' => 'p%eponOnuOpmCardIndex%/%eponOnuOpmPonIndex%' ],
+  'descr'          => 'TX Power ONU %eponOnuOpmOnuIndex%',
+  'oid'            => 'eponOnuOpmTXPower',
+  //'oid_num'        => '.1.3.6.1.4.1.6339.100.30.1.1.22',
+  'scale'          => 1,
+  'limit_low'      => -32,
+  'invalid'        => -32
+];
+
+// static limits from ONU specification (other ONU have the same limits):
+// https://shop.nag.ru/catalog/03903.gpon--gepon/33751.abonentskie-ustrojstva-ontonu/22022.snr-onu-epon-1g#link-params
+// https://shop.nag.ru/catalog/03903.gpon--gepon/33751.abonentskie-ustrojstva-ontonu/22022.snr-onu-epon-1g/properties
+$config['mibs'][$mib]['sensor'][] = [
+  'table'          => 'eponOnuOpmTable',
+  'class'          => 'dbm',
+  'measured'       => 'port',
+  'measured_match' => [ 'entity_type' => 'port', 'field' => 'ifName', 'match' => 'p%eponOnuOpmCardIndex%/%eponOnuOpmPonIndex%' ],
+  'descr'          => 'RX Power ONU %eponOnuOpmOnuIndex%',
+  'oid'            => 'eponOnuOpmRxPower',
+  //'oid_num'        => '.1.3.6.1.4.1.6339.100.30.1.1.17',
+  'scale'          => 1,
+  'limit_low'      => -8,
+  'limit_high'     => -27,
+];
+
 // QTECH (like DCN)
-
 $mib = 'QTECH-MIB';
 $config['mibs'][$mib]['enable'] = 1;
 $config['mibs'][$mib]['identity_num'] = '.1.3.6.1.4.1.27514';
