For measuring the temperature inside an enclosure or rack, use a probe with a sheath. Some sheaths come with mounting hardware attached. These probes might have plates with screw holes for mounting to flat surfaces or clamps for attaching to pipes. Thermocouples are the most popular temperature probes. You can mount the sensor several hundred feet from the electronics that measure its output.
Thermocouples come in different types depending on their composition.
If you have a DMM that can measure temperature, it probably works with type-K thermocouples. Your meter may also accept other thermocouple types such as type J or type T, and it may accept RTDs. The simplest thermocouple assembly consists of two thermocouple wires crimped or welded together at one end. Most thermocouple meters have a heat-conducting block to minimize any temperature difference between the wires at the meter. While using just unsheathed wires is certainly easy and inexpensive, the thermocouple is prone to damage unless you permanently mount it.