Index: includes/definitions/mibs/d-link.inc.php
===================================================================
--- includes/definitions/mibs/d-link.inc.php	(revision 11366)
+++ includes/definitions/mibs/d-link.inc.php	(working copy)
@@ -27,35 +27,27 @@
   'oid_num' => '.1.3.6.1.4.1.171.12.1.1.6.3.0'
 ];
 
-/* BAD results on some devices like DES-3526
-$type = 'swCpuInterfacefilterState';
-$config['mibs'][$mib]['states'][$type][1] = ['name' => 'enable',  'event' => 'ok'];
-$config['mibs'][$mib]['states'][$type][2] = ['name' => 'disable', 'event' => 'warning'];
+/* agentFLASHutilizationTable
+AGENT-GENERAL-MIB::agentFLASHutilizationUnitID.0 = INTEGER: 0
+AGENT-GENERAL-MIB::agentFLASHutilizationTotalFLASH.0 = INTEGER: 16384 KB
+AGENT-GENERAL-MIB::agentFLASHutilizationUsedFLASH.0 = INTEGER: 8553 KB
+AGENT-GENERAL-MIB::agentFLASHutilization.0 = INTEGER: 52
 
-//ACLMGMT-MIB::swCpuInterfacefilterState.0 = INTEGER: disable(2)
-//ACLMGMT-MIB::swACLTotalUsedRuleEntries.0 = INTEGER: 0
-//ACLMGMT-MIB::swACLTotalUnusedRuleEntries.0 = INTEGER: 256
-//ACLMGMT-MIB::swACLMaskDelAllState.0 = INTEGER: none(1)
-//ACLMGMT-MIB::swAclMeteringNumOfEntryInUse.0 = INTEGER: 0
-$config['mibs'][$mib]['status'][] = [
-  'measured'     => 'other',
-  'oid'          => 'swCpuInterfacefilterState',
-  'type'         => 'swCpuInterfacefilterState',
-  'oid_num'      => '.1.3.6.1.4.1.171.12.9.1.1',
-  'descr'        => 'CPU Interface Filtering'
+Command: show utilization flash
+FLASH Memory Utilization : 
+Total FLASH	: 16,384    KB
+Used FLASH	: 8,553     KB
+Utilization	: 52 %
+*/
+$config['mibs'][$mib]['storage']['agentFLASHutilizationTable'] = [
+  'table'     => 'agentFLASHutilizationTable',
+  'descr'     => 'FLASH',
+  'oid_used'  => 'agentFLASHutilizationUsedFLASH',
+  'oid_total' => 'agentFLASHutilizationTotalFLASH',
+  'oid_perc'  => 'agentFLASHutilization',
+  'scale'     => 1000
 ];
 
-$config['mibs'][$mib]['graphs']['swACLEntries'] = [
-  'file'          => 'swacl-entries.rrd',
-  'call_function' => 'snmp_get',
-  'graphs'        => array('swacl-entries'),
-  'ds_rename'     => array('swACLTotalUsedRuleEntries' => 'usedEntries', 'swACLTotalUnusedRuleEntries' => 'unusedEntries'),
-  'oids'          => array(
-    'swACLTotalUsedRuleEntries'         => array('descr' => 'Total Used Rule Entries',   'ds_type' => 'GAUGE', 'ds_min' => '0'),
-    'swACLTotalUnusedRuleEntries'       => array('descr' => 'Total Unused Rule Entries', 'ds_type' => 'GAUGE', 'ds_min' => '0')
-  )
-];
-*/
 $mib = 'EQUIPMENT-MIB';
 $config['mibs'][$mib]['enable'] = 1;
 $config['mibs'][$mib]['identity_num'] = '.1.3.6.1.4.1.171.12.11';
@@ -122,12 +114,9 @@
 $config['mibs'][$mib]['identity_num'] = '.1.3.6.1.4.1.171.12.72';
 $config['mibs'][$mib]['mib_dir'] = 'd-link';
 
+// discovery moved to includes/discovery/sensors/ddm-mgmt-mib.inc.php
+
 /*
-SNMP table: DDM-MGMT-MIB::swDdmStatusTable
- swDdmPort swDdmTemperature swDdmVoltage swDdmBiasCurrent swDdmTxPower swDdmRxPower
-         1          34.5742        3.261            30.08       0.0606       0.0893
-*/
-
 $config['mibs'][$mib]['sensor'][] = [
   'measured'           => 'port',
   'table'              => 'swDdmStatusTable',
@@ -178,6 +167,7 @@
   //'unit'               => 'W',
   'scale'              => 0.001
 ];
+*/
 
 $mib = 'ZONE-DEFENSE-MGMT-MIB';
 $config['mibs'][$mib]['enable'] = 1;
@@ -704,7 +694,9 @@
 $config['mibs'][$mib]['identity_num'] = '.1.3.6.1.4.1.171.12.8';
 $config['mibs'][$mib]['mib_dir'] = 'd-link';
 $config['mibs'][$mib]['descr'] = 'The Single IP management MIB.';
+*/
 
+/*
 $mib = 'ACLMGMT-MIB';
 $config['mibs'][$mib]['enable'] = 1;
 $config['mibs'][$mib]['identity_num'] = '.1.3.6.1.4.1.171.12.9';
@@ -711,6 +703,37 @@
 $config['mibs'][$mib]['mib_dir'] = 'd-link';
 $config['mibs'][$mib]['descr'] = 'The structure of Access Control List information for the proprietary enterprise.';
 
+// BAD results on some devices like DES-3526
+$type = 'swCpuInterfacefilterState';
+$config['mibs'][$mib]['states'][$type][1] = ['name' => 'enable',  'event' => 'ok'];
+$config['mibs'][$mib]['states'][$type][2] = ['name' => 'disable', 'event' => 'warning'];
+
+//ACLMGMT-MIB::swCpuInterfacefilterState.0 = INTEGER: disable(2)
+//ACLMGMT-MIB::swACLTotalUsedRuleEntries.0 = INTEGER: 0
+//ACLMGMT-MIB::swACLTotalUnusedRuleEntries.0 = INTEGER: 256
+//ACLMGMT-MIB::swACLMaskDelAllState.0 = INTEGER: none(1)
+//ACLMGMT-MIB::swAclMeteringNumOfEntryInUse.0 = INTEGER: 0
+$config['mibs'][$mib]['status'][] = [
+  'measured'     => 'other',
+  'oid'          => 'swCpuInterfacefilterState',
+  'type'         => 'swCpuInterfacefilterState',
+  'oid_num'      => '.1.3.6.1.4.1.171.12.9.1.1',
+  'descr'        => 'CPU Interface Filtering'
+];
+
+$config['mibs'][$mib]['graphs']['swACLEntries'] = [
+  'file'          => 'swacl-entries.rrd',
+  'call_function' => 'snmp_get',
+  'graphs'        => array('swacl-entries'),
+  'ds_rename'     => array('swACLTotalUsedRuleEntries' => 'usedEntries', 'swACLTotalUnusedRuleEntries' => 'unusedEntries'),
+  'oids'          => array(
+    'swACLTotalUsedRuleEntries'         => array('descr' => 'Total Used Rule Entries',   'ds_type' => 'GAUGE', 'ds_min' => '0'),
+    'swACLTotalUnusedRuleEntries'       => array('descr' => 'Total Unused Rule Entries', 'ds_type' => 'GAUGE', 'ds_min' => '0')
+  )
+];
+*/
+
+/*
 $mib = 'TIME-MIB';
 $config['mibs'][$mib]['enable'] = 1;
 $config['mibs'][$mib]['identity_num'] = '.1.3.6.1.4.1.171.12.10';
Index: includes/discovery/inventory/des3018-l2mgmt-mib.inc.php
===================================================================
--- includes/discovery/inventory/des3018-l2mgmt-mib.inc.php	(nonexistent)
+++ includes/discovery/inventory/des3018-l2mgmt-mib.inc.php	(working copy)
@@ -0,0 +1 @@
+link des3026-l2mgmt-mib.inc.php
\ No newline at end of file

Property changes on: includes/discovery/inventory/des3018-l2mgmt-mib.inc.php
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Index: includes/discovery/inventory/des3026-l2mgmt-mib.inc.php
===================================================================
--- includes/discovery/inventory/des3026-l2mgmt-mib.inc.php	(nonexistent)
+++ includes/discovery/inventory/des3026-l2mgmt-mib.inc.php	(working copy)
@@ -0,0 +1,94 @@
+<?php
+
+  if (is_device_mib($device, 'DES3026-L2MGMT-MIB')) {
+    $desmib = 'DES3026-L2MGMT-MIB';
+    $copperports = 24;
+  } elseif  (is_device_mib($device, 'DES3018-L2MGMT-MIB')) {
+    $desmib = 'DES3018-L2MGMT-MIB';
+    $copperports = 16;
+  }
+
+  print_debug_vars($inventory);
+
+  if ($desmib) {
+    echo($desmib);
+    $revision                    = snmp_get_oid($device, 'probeHardwareRev.0',  'RMON2-MIB');
+    $system_index = 1;
+    $inventory[$system_index] = array(
+        'entPhysicalDescr'        => $device['sysDescr'],
+        'entPhysicalClass'        => 'chassis',
+        'entPhysicalName'         => $device['hardware'],
+        'entPhysicalHardwareRev'  => $revision,
+        'entPhysicalSoftwareRev'  => $device['version'],
+        'entPhysicalIsFRU'        => 'true',
+        'entPhysicalModelName'    => $device['hardware'],
+        'entPhysicalSerialNum'    => $device['serial'],
+        'entPhysicalContainedIn'  => 0,
+        'entPhysicalParentRelPos' => 1,
+        'entPhysicalMfgName'      => 'D-Link',
+    );
+    discover_inventory($device, $system_index, $inventory[$system_index], "$desmib");
+
+    for ($port = 1; $port <= $copperports; $port++) {
+      $system_index = 100 + $port;
+      $inventory[$system_index] = array(
+          'entPhysicalDescr'        => '100Base-T Copper Port',
+          'entPhysicalClass'        => 'port',
+          'entPhysicalName'         => 'Port '.$port,
+          'entPhysicalIsFRU'        => 'false',
+          'entPhysicalModelName'    => 'Copper Port',
+          'entPhysicalContainedIn'  => 1,
+          'entPhysicalParentRelPos' => $port,
+          'ifIndex'                 => $port,
+      );
+      discover_inventory($device, $system_index, $inventory[$system_index], "$desmib");
+    }
+
+    for ($slot = 1; $slot <= 2; $slot++) {
+      // Slot 1
+      $system_index = 100 + $port;
+      $inventory[$system_index] = array(
+        'entPhysicalDescr'        => 'DES-3018/3026 extended Slot',
+        'entPhysicalClass'        => 'container',
+        'entPhysicalName'         => 'Slot '.$slot,
+        'entPhysicalIsFRU'        => 'false',
+        'entPhysicalModelName'    => 'Extended Slot',
+        'entPhysicalContainedIn'  => 1,
+        'entPhysicalParentRelPos' => $port,
+      );
+      discover_inventory($device, $system_index, $inventory[$system_index], "$desmib");
+      if ($slot == 1) {
+        $des30xxswL2ModuleXType      = snmp_get_oid($device, 'swL2Module-1-Type.0', $desmib);
+      } else {
+        $des30xxswL2ModuleXType      = snmp_get_oid($device, 'swL2Module-2-Type.0', $desmib);
+      }
+      $system2_index = 200 + $port;
+      $inventory[$system2_index] = array(
+        'entPhysicalDescr'        => $des30xxswL2ModuleXType,
+        'entPhysicalClass'        => 'module',
+        'entPhysicalName'         => 'Module '.$slot,
+        'entPhysicalIsFRU'        => 'true',
+        'entPhysicalContainedIn'  => $system_index,
+        'entPhysicalParentRelPos' => 0,
+        'entPhysicalMfgName'      => 'D-Link',
+      );
+      discover_inventory($device, $system2_index, $inventory[$system2_index], "$desmib");
+      $system3_index = 300 + $port;
+      $inventory[$system3_index] = array(
+        'entPhysicalDescr'        => 'Gigabit Ethernet',
+        'entPhysicalClass'        => 'port',
+        'entPhysicalIsFRU'        => 'false',
+        'entPhysicalContainedIn'  => $system2_index,
+        'entPhysicalParentRelPos' => 0,
+        'ifIndex'                 => $port,
+      );
+      discover_inventory($device, $system3_index, $inventory[$system3_index], "$desmib");
+      // Slot 2
+      $port++;
+    }
+      print_debug_vars($inventory);
+  } else {
+    return;
+  }
+
+// EOF
Index: includes/discovery/inventory/entity-mib.inc.php
===================================================================
--- includes/discovery/inventory/entity-mib.inc.php	(revision 11366)
+++ includes/discovery/inventory/entity-mib.inc.php	(working copy)
@@ -41,6 +41,19 @@
   //print_vars($entity_array);
   //print_debug_vars($vendor_oids);
 }
+if (is_device_mib($device, 'DGS3627G-L2MGMT-MIB'))
+{
+  $dlinkmib = 'DGS3627G-L2MGMT-MIB'; 
+  $vendor_oids = snmpwalk_cache_oid($device, "swL2PortSfpInfoTable", $vendor_oids, $dlinkmib, NULL, $snmp_flags);
+  //print_vars($entity_array);
+  //print_debug_vars($vendor_oids);
+} elseif (is_device_mib($device, 'DGS3120-24SC-L2MGMT-MIB'))
+{
+  $dlinkmib = 'DGS3120-24SC-L2MGMT-MIB';
+  $vendor_oids = snmpwalk_cache_oid($device, "swL2PortSfpInfoTable", $vendor_oids, $dlinkmib, NULL, $snmp_flags);
+  print_vars($entity_array);
+  print_debug_vars($vendor_oids);
+}
 
 foreach ($entity_array as $entPhysicalIndex => $entry)
 {
@@ -110,6 +123,69 @@
     $entry['entPhysicalMfgName']     = trim($vendor_oids[$entry['ifIndex']]['eltPhdTransceiverInfoVendorName']);
     $entry['entPhysicalModelName']   = trim($vendor_oids[$entry['ifIndex']]['eltPhdTransceiverInfoComplianceCode']);
   }
+  if (is_device_mib($device, $dlinkmib) && ($entry['entPhysicalModelName'] == "Fiber Port") && isset($vendor_oids[$entry['entPhysicalParentRelPos']]) && is_numeric($vendor_oids[$entry['entPhysicalParentRelPos']]['swL2PortSfpInfoDateCode']))
+  {
+       //$entry = array_merge($entry, $vendor_oids[$entry['ifIndex']]);
+    print_debug_vars($vendor_oids[$entry['entPhysicalParentRelPos']]);
+    /*
+  [13] => array(
+            [entPhysicalDescr]        => string(29) "1000_TXGBIC_COMBO Copper Port"
+            [entPhysicalVendorType]   => string(11) "zeroDotZero"
+            [entPhysicalContainedIn]  => string(1) "2"
+            [entPhysicalClass]        => string(4) "port"
+            [entPhysicalParentRelPos] => string(2) "21"
+            [entPhysicalName]         => string(7) "Port 21"
+            [entPhysicalHardwareRev]  => string(0) ""
+            [entPhysicalFirmwareRev]  => string(0) ""
+            [entPhysicalSoftwareRev]  => string(0) ""
+            [entPhysicalSerialNum]    => string(0) ""
+            [entPhysicalMfgName]      => string(0) ""
+            [entPhysicalModelName]    => string(11) "Copper Port"
+            [entPhysicalAlias]        => string(0) ""
+            [entPhysicalAssetID]      => string(0) ""
+            [entPhysicalIsFRU]        => string(5) "false"
+          )
+...
+  [37] => array(
+            [entPhysicalDescr]        => string(28) "1000_TXGBIC_COMBO Fiber Port"
+            [entPhysicalVendorType]   => string(11) "zeroDotZero"
+            [entPhysicalContainedIn]  => string(1) "2"
+            [entPhysicalClass]        => string(4) "port"
+            [entPhysicalParentRelPos] => string(2) "21"
+            [entPhysicalName]         => string(7) "Port 21"
+            [entPhysicalHardwareRev]  => string(0) ""
+            [entPhysicalFirmwareRev]  => string(0) ""
+            [entPhysicalSoftwareRev]  => string(0) ""
+            [entPhysicalSerialNum]    => string(0) ""
+            [entPhysicalMfgName]      => string(0) ""
+            [entPhysicalModelName]    => string(10) "Fiber Port"
+            [entPhysicalAlias]        => string(0) ""
+            [entPhysicalAssetID]      => string(0) ""
+            [entPhysicalIsFRU]        => string(5) "false"
+          )
+     */
+    /*
+  [21] => array(
+            [swL2PortSfpInfoPortIndex]   => string(2) "21"
+            [swL2PortSfpInfoConnectType] => string(6) "SFP LC"
+            [swL2PortSfpInfoVendorName]  => string(3) "OEM"
+            [swL2PortSfpInfoVendorPN]    => string(10) "SFP-BX-U31"
+            [swL2PortSfpInfoVendorSN]    => string(8) "F10GU046"
+            [swL2PortSfpInfoVendorOUI]   => string(6) "0:0:0."
+            [swL2PortSfpInfoVendorRev]   => string(3) "1.0"
+            [swL2PortSfpInfoDateCode]    => string(6) "090701"
+            [swL2PortSfpInfoFiberType]   => string(16) "Single Mode (SM)"
+            [swL2PortSfpInfoBaudRate]    => string(4) "1300"
+            [swL2PortSfpInfoWavelength]  => string(4) "1310"
+          )
+     */
+    $entry['entPhysicalVendorType']  = trim($vendor_oids[$entry['entPhysicalParentRelPos']]['swL2PortSfpInfoConnectType']);
+    $entry['entPhysicalHardwareRev'] = trim($vendor_oids[$entry['entPhysicalParentRelPos']]['swL2PortSfpInfoVendorPN']);
+    $entry['entPhysicalFirmwareRev'] = trim($vendor_oids[$entry['entPhysicalParentRelPos']]['swL2PortSfpInfoVendorRev']);
+    $entry['entPhysicalSerialNum']   = trim($vendor_oids[$entry['entPhysicalParentRelPos']]['swL2PortSfpInfoVendorSN']);
+    $entry['entPhysicalMfgName']     = trim($vendor_oids[$entry['entPhysicalParentRelPos']]['swL2PortSfpInfoVendorName']);
+    $entry['entPhysicalModelName']   = trim($vendor_oids[$entry['entPhysicalParentRelPos']]['swL2PortSfpInfoFiberType']);
+  }
 
   if ($entry['entPhysicalDescr'] || $entry['entPhysicalName'])
   {
Index: includes/discovery/sensors/ddm-mgmt-mib.inc.php
===================================================================
--- includes/discovery/sensors/ddm-mgmt-mib.inc.php	(nonexistent)
+++ includes/discovery/sensors/ddm-mgmt-mib.inc.php	(working copy)
@@ -0,0 +1,185 @@
+<?php
+/**
+ * Observium
+ *
+ *   This file is part of Observium.
+ *
+ * @package    observium
+ * @subpackage discovery
+ * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
+ *
+ */
+
+/*
+in mw (config ddm power_unit mw)
+Command: show ddm ports 1 status
+ Port    Temperature   Voltage    Bias Current   TX Power     RX Power
+        (in Celsius)     (V)         (mA)         (mW)         (mW)
+------- ------------- ---------- -------------- ---------- ------------
+  1        45.2305      3.2733       31.584       0.0578       0.0929
+
+Command: show ddm ports 1 configuration
+Port:            1
+--------------------------------------------
+DDM state : Enabled
+Shutdown  : None
+Threshold       Temperature    Voltage   Bias-Current   TX-Power  RX-Power
+------------ --------------- --------- ------------- ----------- ----------
+High Alarm        110.0000      3.6000      80.0000     0.3981      0.6310
+Low Alarm         -45.0000      3.0000      2.0000      0.0251      0.0050
+High Warning      95.0000       3.5000      70.0000     0.3162      0.5012
+Low Warning       -42.0000      3.0500      3.0000      0.0316      0.0063
+
+DDM-MGMT-MIB::swDdmTrapState.0 = INTEGER: disabled(2)
+DDM-MGMT-MIB::swDdmLogState.0 = INTEGER: enabled(1)
+DDM-MGMT-MIB::swDdmPowerUnit.0 = INTEGER: mw(1)
+DDM-MGMT-MIB::swDdmPort.1 = INTEGER: 1
+DDM-MGMT-MIB::swDdmTemperature.1 = STRING: 45.2305
+DDM-MGMT-MIB::swDdmVoltage.1 = STRING: 3.2477
+DDM-MGMT-MIB::swDdmBiasCurrent.1 = STRING: 31.584
+DDM-MGMT-MIB::swDdmTxPower.1 = STRING: 0.0583
+DDM-MGMT-MIB::swDdmRxPower.1 = STRING: 0.0932
+DDM-MGMT-MIB::swDdmPortState.1 = INTEGER: enabled(1)
+DDM-MGMT-MIB::swDdmPortShutdown.1 = INTEGER: none(3)
+*/
+
+/*
+in dbm (config ddm power_unit dbm)
+Command: show ddm ports 1 status
+ Port    Temperature   Voltage    Bias Current   TX Power     RX Power
+        (in Celsius)     (V)         (mA)         (dBm)        (dBm)
+------- ------------- ---------- -------------- ---------- ------------
+  1        45.7148      3.2477       31.584       -12.3807     -10.2919
+
+Command: show ddm ports 1 configuration
+Port:            1
+--------------------------------------------
+DDM state : Enabled
+Shutdown  : None
+Threshold       Temperature    Voltage   Bias-Current   TX-Power  RX-Power
+------------ --------------- --------- ------------- ----------- ----------
+High Alarm        110.0000      3.6000      80.0000     -4.0001     -1.9997
+Low Alarm         -45.0000      3.0000      2.0000      -16.0033    -23.0103
+High Warning      95.0000       3.5000      70.0000     -5.0004     -2.9999
+Low Warning       -42.0000      3.0500      3.0000      -15.0031    -22.0066
+
+DDM-MGMT-MIB::swDdmTrapState.0 = INTEGER: disabled(2)
+DDM-MGMT-MIB::swDdmLogState.0 = INTEGER: enabled(1)
+DDM-MGMT-MIB::swDdmPowerUnit.0 = INTEGER: dbm(2)
+DDM-MGMT-MIB::swDdmPort.1 = INTEGER: 1
+DDM-MGMT-MIB::swDdmTemperature.1 = STRING: 45.2305
+DDM-MGMT-MIB::swDdmVoltage.1 = STRING: 3.2354
+DDM-MGMT-MIB::swDdmBiasCurrent.1 = STRING: 31.584
+DDM-MGMT-MIB::swDdmTxPower.1 = STRING: -12.3807
+DDM-MGMT-MIB::swDdmRxPower.1 = STRING: -10.2826
+DDM-MGMT-MIB::swDdmPortState.1 = INTEGER: enabled(1)
+DDM-MGMT-MIB::swDdmPortShutdown.1 = INTEGER: none(3)
+*/
+
+$oids = snmpwalk_cache_oid($device, 'swDdmStatusTable', [], $mib);
+print_debug_vars($oids);
+
+if (!snmp_status()) { return; }
+
+// oid exists on D-Link
+//// -- DGS-3627G 1A1G with firmware 3.03.B04
+//// -- DES-3200-28/C1 with firmware 4.46.B008
+//// (command "config ddm power_unit dbm" supported)
+// oid doesn't exists on D-Link
+//// -- DGS-3120-24SC B1 with firmware 3.12.R510
+//// -- DES-3526 A4 with firmware 6.20.B20/B21/B30
+//// -- DES-3550 A4G with firmware 6.20.B20
+//// (command "config ddm power_unit dbm" unsupported) - tx/rx power always in mw
+
+//DDM-MGMT-MIB::swDdmPowerUnit.0 = INTEGER: dbm(2)
+$power_unit = snmp_get_oid($device, 'swDdmPowerUnit.0', $mib);
+
+if (!snmp_status()) { $power_unit = 'mw'; }
+
+$oids_limit = snmpwalk_cache_twopart_oid($device, 'swDdmThresholdMgmtEntry', [], $mib);
+print_debug_vars($oids_limit);
+
+foreach ($oids as $index => $entry) {
+  $entry['index']   = $index;
+  $match = [ 'measured_match' => [ 'entity_type' => 'port', 'field' => 'ifIndex', 'match' => '%index%' ] ];
+  $options = entity_measured_match_definition($device, $match, $entry);
+
+  $name = $options['port_label'];
+
+  // Temperature
+  $descr     = $name . ' Temperature';
+  $class     = 'temperature';
+  $oid_name  = 'swDdmTemperature';
+  $oid_num   = '.1.3.6.1.4.1.171.12.72.2.1.1.1.2.'.$index;
+  $scale     = 1;
+  $value     = $entry[$oid_name];
+  $limits    = [
+    'limit_high'       => $oids_limit[$index]['temperature']['swDdmHighAlarm'],
+    'limit_low'        => $oids_limit[$index]['temperature']['swDdmLowAlarm'],
+    'limit_high_warn'  => $oids_limit[$index]['temperature']['swDdmHighWarning'],
+    'limit_low_warn'   => $oids_limit[$index]['temperature']['swDdmLowWarning']
+  ];
+  discover_sensor_ng($device, $class, $mib, $oid_name, $oid_num, $index, NULL, $descr, $scale, $value, array_merge($options, $limits));
+
+  // Voltage
+  $descr     = $name . ' Voltage';
+  $class     = 'voltage';
+  $oid_name  = 'swDdmVoltage';
+  $oid_num   = '.1.3.6.1.4.1.171.12.72.2.1.1.1.3.'.$index;
+  $scale     = 1;
+  $value     = $entry[$oid_name];
+  $limits    = [
+    'limit_high'       => $oids_limit[$index]['voltage']['swDdmHighAlarm'],
+    'limit_low'        => $oids_limit[$index]['voltage']['swDdmLowAlarm'],
+    'limit_high_warn'  => $oids_limit[$index]['voltage']['swDdmHighWarning'],
+    'limit_low_warn'   => $oids_limit[$index]['voltage']['swDdmLowWarning']
+  ];
+  discover_sensor_ng($device, $class, $mib, $oid_name, $oid_num, $index, NULL, $descr, $scale, $value, array_merge($options, $limits));
+
+  // Tx Bias
+  $descr     = $name . ' Tx Bias';
+  $class     = 'current';
+  $oid_name  = 'swDdmBiasCurrent';
+  $oid_num   = '.1.3.6.1.4.1.171.12.72.2.1.1.1.4.'.$index;
+  $scale     = 1;
+  $value     = $entry[$oid_name];
+  $limits    = [
+    'limit_high'       => $oids_limit[$index]['bias']['swDdmHighAlarm'],
+    'limit_low'        => $oids_limit[$index]['bias']['swDdmLowAlarm'],
+    'limit_high_warn'  => $oids_limit[$index]['bias']['swDdmHighWarning'],
+    'limit_low_warn'   => $oids_limit[$index]['bias']['swDdmLowWarning']
+  ];
+  discover_sensor_ng($device, $class, $mib, $oid_name, $oid_num, $index, NULL, $descr, $scale, $value, array_merge($options, $limits));
+
+  // Tx Power
+  $descr     = $name . ' Tx Power';
+  $class     = $power_unit === 'mw' ? 'power' : 'dbm';
+  $oid_name  = 'swDdmTxPower';
+  $oid_num   = '.1.3.6.1.4.1.171.12.72.2.1.1.1.5.'.$index;
+  $scale     = $power_unit === 'mw' ? 0.001 : 1;
+  $value     = $entry[$oid_name];
+  $limits    = [
+    'limit_high'       => $oids_limit[$index]['txPower']['swDdmHighAlarm'] * $scale,
+    'limit_low'        => $oids_limit[$index]['txPower']['swDdmLowAlarm'] * $scale,
+    'limit_high_warn'  => $oids_limit[$index]['txPower']['swDdmHighWarning'] * $scale,
+    'limit_low_warn'   => $oids_limit[$index]['txPower']['swDdmLowWarning'] * $scale
+  ];
+  discover_sensor_ng($device, $class, $mib, $oid_name, $oid_num, $index, NULL, $descr, $scale, $value, array_merge($options, $limits));
+
+  // Rx Power
+  $descr     = $name . ' Rx Power';
+  $class     = $power_unit === 'mw' ? 'power' : 'dbm';
+  $oid_name  = 'swDdmRxPower';
+  $oid_num   = '.1.3.6.1.4.1.171.12.72.2.1.1.1.6.'.$index;
+  $scale     = $power_unit === 'mw' ? 0.001 : 1;
+  $value     = $entry[$oid_name];
+  $limits    = [
+    'limit_high'       => $oids_limit[$index]['rxPower']['swDdmHighAlarm'] * $scale,
+    'limit_low'        => $oids_limit[$index]['rxPower']['swDdmLowAlarm'] * $scale,
+    'limit_high_warn'  => $oids_limit[$index]['rxPower']['swDdmHighWarning'] * $scale,
+    'limit_low_warn'   => $oids_limit[$index]['rxPower']['swDdmLowWarning'] * $scale
+  ];
+  discover_sensor_ng($device, $class, $mib, $oid_name, $oid_num, $index, NULL, $descr, $scale, $value, array_merge($options, $limits));
+}
+
+// EOF
Index: mibs/d-link/DDM-MGMT-MIB
===================================================================
--- mibs/d-link/DDM-MGMT-MIB	(revision 11366)
+++ mibs/d-link/DDM-MGMT-MIB	(working copy)
@@ -13,6 +13,11 @@
 --  [New Object]		
 --  [Modification]
 -- Notes: (Requested by who and which project)
+-- Version 1.03, 2012/03/20, Rondom Ren
+-- Description:
+-- [New Object]
+-- [1]Add swDdmPowerUnit in swDdmCtrl to show and configure TX/RX power global unit.
+-- Requested by Rondom Ren for project DGS3600 R3.
 --
 -- Version 1.02, 2009/04/30, Strive Zhao
 -- Description:
@@ -51,7 +56,7 @@
             FROM DLINK-ID-REC-MIB;
 
 swDdmMIB	MODULE-IDENTITY
-          LAST-UPDATED "0904300000Z"
+          LAST-UPDATED "1203200000Z"
           ORGANIZATION "D-Link Corp."
           CONTACT-INFO
                       "http://support.dlink.com"
@@ -89,6 +94,17 @@
     DESCRIPTION
         "This object indicates the log action state."
         ::= {swDdmCtrl 2}
+swDdmPowerUnit    OBJECT-TYPE
+    SYNTAX  INTEGER {
+                     mw(1),
+                     dbm(2)
+                    }
+    MAX-ACCESS  read-write
+    STATUS  current
+    DESCRIPTION
+        "This object indicates the TX/RX power global unit."
+    DEFVAL{mw}
+        ::= {swDdmCtrl 3}
         
 -- --------------------------------------------------------------------------
 -- swDdmInfo
