$entries) { foreach ($entries as $i => $entry) { $index = "$unit.$i"; $descr = "Sensor $i (Unit $unit)"; $oid_name = 'switchThermalTempValue'; $oid_num = '.1.3.6.1.4.1.52642.2.1.45.1.1.11.1.3.' . $index; //$type = $mib . '-' . $oid_name; $value = $entry[$oid_name]; // Limits if (isset($port_sw[$entry['connUnitPortIndex']])) { $entry = array_merge($entry, array_shift($limit_oids[$unit][$i])); } $limits = [ 'limit_high' => $entry['switchThermalActionRisingThreshold'], 'limit_high_warn' => $entry['switchThermalActionFallingThreshold'] ]; discover_sensor_ng($device, 'temperature', $mib, $oid_name, $oid_num, $index, $descr, 1, $value, $limits); } } // EOF