It’s been two moves, and I’m looking at another move before Christmas, since my last post. The topic of this post is going back to my roots a bit. I have always enjoyed a home lab, and having bare metal to run on is my preference. So, prior to my move this fall, working with ChatGPT and watching a ton of YouTube videos on home lab’ing; I (we, can we say we?) came up with the idea of instead of 400W massive Dell r7xx, why not go with micro form factor machines. They sip power (35W), and take up far less space, and are so much quieter.

Off to eBay I went and found an off lease 20 lot of Dell Micro 7040’s with no hard drive or ram. They wanted 500 bucks, and I offered 300, and won the auction, so just under 400 bucks taxes and shipping, a massive box arrived with all 20 of them. Plus some power supplies, the next day, another box of just power supplies showed up.

I needed some parts to be able to test them. So, I ordered a 16 Gig DDR SODIMM from Memory Express for 50 dollars(https://www.memoryexpress.com/Products/MX00116745), and a 120Gig Patriot Blue SSD on amazon, it was 15 bucks. Oh, and a 128 gig usb-3 thumb drive to have a live Mint install on. This install of parts became the “Gold Standard”. After installing Mint on the SSD, I realized, I couldn’t pull apt updates or add anything that didn’t come in the base install of Linux, because these machines don’t include wifi or bluetooth, which in my dev environment, would be totally acceptable, but to get data on and off the machines, plus pull updates, I would need internet access.

There were a few options, grab a monitor, keyboard and mouse, and go downstairs to beside the model and plug directly in, but that would be too much effort, I realize I would only need to do that process twice, once at the start, and once at the end to pull the test files off (more on that later). So, amazon again for the win. I ordered a TP-link AC-1300 wifi USB adapter for 19 dollars, and arrived the next day.

This Labour Day weekend, after the final grass cutting of the year (I hope), I started testing them. I am using a script developed by ChatGPT and modified by me. You need to install a few nonstandard packages for the script to run, mainly “stress-ng”. Here is the code:

#!/usr/bin/env bash
# Simple hardware sanity check for Dell OptiPlex 7040 Micro
# Runs quick probes + short stress test and logs results.
# other start up commands to install software, cut and paste into terminal
# sudo apt update
# sudo apt install -y stress-ng lm-sensors neofetch smartmontools pciutils usbutils
# optional: iperf3 if you want a LAN throughput check
# sudo apt install -y iperf3


#!/usr/bin/env bash
set -u  # error on unset vars

# --- functions ---
log() { echo -e "$@" | tee -a "$LOG"; }
hr()  { log "\n================================================================\n"; }

# --- timestamp + service tag for logfile ---
TS="$(date +'%Y%m%d-%H%M%S')"
TAG="$(sudo dmidecode -s system-serial-number 2>/dev/null || hostname)"
TAG="${TAG// /_}"   # replace spaces with underscores
LOG="labcheck-${TAG}-${TS}.log"

# --- header section ---
log "Starting LABCHECK at $(date)"
log "Host: $(hostname)  User: $USER  Kernel: $(uname -r)"
log "Service Tag: $TAG"
hr



# --- Basic ID / summary
if command -v neofetch >/dev/null 2>&1; then
  neofetch --off | tee -a "$LOG"
else
  log "neofetch not found; skipping."
fi
hr

# --- CPU / RAM quick look
log "CPU INFO:"
lscpu | grep -E 'Model name|CPU\(s\)|Thread|MHz|Vendor' | tee -a "$LOG"
log "\nMEMORY:"
free -h | tee -a "$LOG"
hr

# --- Storage (controllers + drives)
log "STORAGE (controllers):"
lspci | grep -Ei 'sata|nvme|storage' | tee -a "$LOG"

log "\nBLOCK DEVICES:"
lsblk -o NAME,TYPE,SIZE,MODEL,TRAN | tee -a "$LOG"


# SMART (needs sudo)
for dev in /dev/sd? /dev/nvme?n?; do
  [ -e "$dev" ] || continue
  log "\nSMART for $dev:"
  sudo smartctl -H "$dev" 2>/dev/null | tee -a "$LOG"
done
hr

# --- Network
log "NETWORK CONTROLLERS:"
lspci | grep -Ei 'ethernet|network' | tee -a "$LOG"

# Try to identify Intel NIC and link speed
IFACE="$(ip -o link show | awk -F': ' '{print $2}' | grep -E '^(e|en)' | head -n1 || true)"
if [ -n "${IFACE:-}" ]; then
  log "\nPRIMARY IFACE: $IFACE"
  ip addr show "$IFACE" | tee -a "$LOG"
  if command -v ethtool >/dev/null 2>&1; then
    log "\nETHTOOL:"
    sudo ethtool "$IFACE" 2>/dev/null | tee -a "$LOG"
  else
    log "Install ethtool for link speed:  sudo apt install -y ethtool"
  fi
else
  log "No ethernet interface detected by ip link."
fi
hr

# --- USB sanity (ports present / enumerate)
log "USB DEVICES:"
lsusb | tee -a "$LOG"
hr

# --- Sensors / temps
log "SENSORS (temps/voltages):"
if sensors >/dev/null 2>&1; then
  sensors | tee -a "$LOG"
else
  log "Run sensors-detect (sudo) once if needed, then re-run labcheck."
fi
hr

# --- Quick stress test (CPU+RAM) ~ 2 minutes
log "STRESS TEST (CPU+RAM) starting (120s)..."
if command -v stress-ng >/dev/null 2>&1; then
  # Use 4 CPU workers (i5-6500T has 4 cores), 1G VM load
  stress-ng --cpu 4 --vm 2 --vm-bytes 1G --timeout 120s --metrics-brief 2>&1 | tee -a "$LOG"
  STRESS_RC=${PIPESTATUS[0]}
else
  log "stress-ng not installed; skipping."
  STRESS_RC=0
fi
hr

# --- Quick pass/fail heuristics
PASS=1

# Check RAM >= 15G if you’re using a 16G stick (adjust if you test other sizes)
MEM_GB=$(free -g | awk '/Mem:/ {print $2}')
if [ -n "${MEM_GB:-}" ] && [ "$MEM_GB" -lt 15 ]; then
  log "WARN: Detected <15G RAM (reported ${MEM_GB}G)"
  PASS=0
fi

# Check NIC looks like Intel
if lspci | grep -qi 'Intel.*Ethernet'; then
  :
else
  log "WARN: No Intel Ethernet adapter detected in lspci output"
  PASS=0
fi

# Check at least one block device found
if lsblk -dn -o NAME | grep -q .; then
  :
else
  log "WARN: No block devices found by lsblk"
  PASS=0
fi

# Stress return code
if [ "${STRESS_RC:-0}" -ne 0 ]; then
  log "WARN: stress-ng reported a non-zero exit status (${STRESS_RC})"
  PASS=0
fi

# --- Summary
if [ "$PASS" -eq 1 ]; then
  log "\nRESULT: ? PASS — hardware looks healthy."
else
  log "\nRESULT: ??  CHECK — review warnings above in $LOG."
fi

log "\nLog saved to: $LOG"
echo

Once you have the file, and the utilities installed, you need to <code> sudo chmod +x filename.sh </code> to make it executable. Then it dumps to a file:

Starting LABCHECK at Mon Sep  1 03:27:38 PM EDT 2025
Host: test-OptiPlex-7040 User: test Kernel: 6.8.0-79-generic
Service Tag: HN63CH2

================================================================

[?25l[?7ltest@test-OptiPlex-7040
-----------------------
OS: Linux Mint 22.1 x86_64
Host: OptiPlex 7040
Kernel: 6.8.0-79-generic
Uptime: 52 mins
Packages: 1854 (dpkg)
Shell: bash 5.2.21
Resolution: 3440x1440
DE: Xfce 4.18
WM: Xfwm4
WM Theme: Mint-Y-Aqua
Theme: Mint-L-Dark-Aqua [GTK2/3]
Icons: Mint-Y-Sand [GTK2/3]
Terminal: xfce4-terminal
Terminal Font: Monospace 12
CPU: Intel i5-6500T (4) @ 3.100GHz
GPU: Intel HD Graphics 530
Memory: 1415MiB / 15877MiB

        
        


[?25h[?7h
================================================================

CPU INFO:
CPU(s): 4
On-line CPU(s) list: 0-3
Vendor ID: GenuineIntel
Model name: Intel(R) Core(TM) i5-6500T CPU @ 2.50GHz
Thread(s) per core: 1
CPU(s) scaling MHz: 84%
CPU max MHz: 3100.0000
CPU min MHz: 800.0000
NUMA node0 CPU(s): 0-3

MEMORY:
total used free shared buff/cache available
Mem: 15Gi 1.6Gi 13Gi 410Mi 1.4Gi 13Gi
Swap: 2.0Gi 1.0Mi 2.0Gi

================================================================

STORAGE (controllers):
00:17.0 RAID bus controller: Intel Corporation SATA Controller [RAID mode] (rev 31)

BLOCK DEVICES:
NAME TYPE SIZE MODEL TRAN
sda disk 111.8G Patriot Burst Elite 120GB sata
??sda1 part 1M
??sda2 part 513M
??sda3 part 111.3G

SMART for /dev/sda:
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.8.0-79-generic] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED


================================================================

NETWORK CONTROLLERS:
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM (rev 31)

PRIMARY IFACE: enp0s31f6
2: enp0s31f6: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 48:4d:7e:e2:e8:f8 brd ff:ff:ff:ff:ff:ff

ETHTOOL:
Settings for enp0s31f6:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Speed: Unknown!
Duplex: Unknown! (255)
Auto-negotiation: on
Port: Twisted Pair
PHYAD: 2
Transceiver: internal
MDI-X: Unknown (auto)
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000007 (7)
drv probe link
Link detected: no

================================================================

USB DEVICES:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 062a:7269 MosArt Semiconductor Corp. Full-Speed Mouse
Bus 001 Device 003: ID 2357:0138 TP-Link 802.11ac NIC
Bus 001 Device 004: ID 04f2:2159 Chicony Electronics Co., Ltd PERIBOARD-535 [Perixx Ergo Keyboard]
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

================================================================

SENSORS (temps/voltages):
coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +41.0°C (high = +84.0°C, crit = +100.0°C)
Core 0: +42.0°C (high = +84.0°C, crit = +100.0°C)
Core 1: +40.0°C (high = +84.0°C, crit = +100.0°C)
Core 2: +42.0°C (high = +84.0°C, crit = +100.0°C)
Core 3: +41.0°C (high = +84.0°C, crit = +100.0°C)

acpitz-acpi-0
Adapter: ACPI interface
temp1: +27.8°C
temp2: +29.8°C

pch_skylake-virtual-0
Adapter: Virtual device
temp1: +57.0°C


================================================================

STRESS TEST (CPU+RAM) starting (120s)...
stress-ng: info: [5125] setting to a 2 mins, 0 secs run per stressor
stress-ng: info: [5125] dispatching hogs: 4 cpu, 2 vm
stress-ng: info: [5125] note: /proc/sys/kernel/sched_autogroup_enabled is 1 and this can impact scheduling throughput for processes not attached to a tty. Setting this to 0 may improve performance metrics
stress-ng: info: [5125] note: 4 cpus have scaling governors set to powersave and this can impact on performance; setting /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor to 'performance' may improve performance
stress-ng: metrc: [5125] stressor bogo ops real time usr time sys time bogo ops/s bogo ops/s
stress-ng: metrc: [5125] (secs) (secs) (secs) (real time) (usr+sys time)
stress-ng: metrc: [5125] cpu 379669 120.00 319.39 0.09 3163.88 1188.40
stress-ng: metrc: [5125] vm 10776523 120.04 129.18 29.65 89773.52 67850.36
stress-ng: info: [5125] skipped: 0
stress-ng: info: [5125] passed: 6: cpu (4) vm (2)
stress-ng: info: [5125] failed: 0
stress-ng: info: [5125] metrics untrustworthy: 0
stress-ng: info: [5125] successful run completed in 2 mins, 0.05 secs

================================================================


RESULT: ? PASS — hardware looks healthy.

Log saved to: labcheck-HN63CH2-20250901-152738.log

Now it will test each machine, and dump it to a log file, and the file name will have the Dell Service Tag in it, which, each machine has the Service Tag on the side on the Dell sticker, so there is no doubt which machine is which.

Some of my struggles with this project:

  • BIOS/ UEFI access never happened. Even after resetting the NVRAM and pulling the battery, no change. It did remove the netboot on start up.
  • The hard drive sleds are old and brittle, so I broke one, that’s 8 bucks to replace on eBay.
  • Getting the script to work, I’m not an expert on BASH, and ChatGPT can only get you so far, but in the end, I have a working script that tests the items I need/ want to test.
  • The time to swap ram/ HD and run the script, it’s going to take a bit of time to test all 20 machines.
  • Kitting them out for my Prod/ Dev Environment, that is going to cost money. Ram and HD’s aren’t cheap.

Overall, fun project that will keep me busy for a few weeks testing the computers. I have already given a few away to some of the IT guys are the office. I really don’t need 20 micro’s. Hopefully they all pass the testing, and I’ll have a nice collection of bare metal devices to use how ever I see fit.

The ideas right now are:

  • Proxmox cluster
  • SDR node – NOAA downlink processor/ weather station data clearing machine
  • Pi-hole style firewall appliance
  • Docker / Containers / Kubernetes / Clustered computing
  • Running VM’s to support or augment the ideas above.

So, that’s where we are, one gold standard install of Mint, two computers tested, and 18 more to go.

Have a great remainder of your long weekend folk.

Drew
sysadmin@alawrence.net