This document addresses friction points, technical boundaries, and known failure modes of the SMD-TUI utility. It is not a marketing brochure; it is a defensive guide designed to prevent user frustration by setting clear expectations upfront.
Read it carefully before reporting problems or modifying the script.
If your workflow deviates from the strict requirements listed below, this script is likely not suitable for your system.
- Philosophy
- Does this script support Windows or macOS?
- Why is the display garbled or misaligned?
- Why do I see "unavailable" or "inactive" for sensors?
- Why are external drives not showing up?
- Why does my SATA HDD show no temperature?
- Why does the script crash or exit immediately?
- Can I customize the update interval?
- Can I customize the colors?
- Is this safe to run on a production server?
- How do I report a bug correctly?
- Can I modify the script?
Most system monitoring tools rely on heavy graphical frameworks (Python, Electron, Qt) or external daemons that introduce significant overhead, latency, and dependency hell. They often fail silently in minimal environments (SSH sessions, recovery consoles, TTY) where resources are scarce and stability is critical.
SMD-TUI exists to provide a pure Bash, zero-dependency (beyond standard coreutils) telemetry stream. It is engineered for:
-
Minimal Overhead
No background daemons, no subshells for data gathering, no external GUI libraries. -
Maximum Portability
Runs whereverbash 4.0+,awk,sed, andgrepexist. -
Deterministic Output
Uses strictprintfformatting to prevent UI jitter during load spikes.
The Trade-off
By rejecting modern abstractions, this script sacrifices "ease of use" for "raw reliability." It assumes the user understands Linux internals (/proc, /sys, hwmon). If you expect a plug-and-play GUI, this tool will frustrate you.
Short Answer: No.
This script relies exclusively on Linux-specific kernel interfaces and filesystem structures:
-
Kernel Interfaces
Reads directly from/proc/stat,/proc/diskstats,/proc/pressure/memory, and/sys/class/hwmon. These paths do not exist on Windows or macOS. -
Filesystem Layout
Depends on the Linux FHS (Filesystem Hierarchy Standard) for device nodes (/dev/sd*,/media/,/run/media/). -
Commands
Usesiproute2(ip),findmnt,acpi, andlm-sensorsin ways specific to the Linux kernel API.
None. While WSL (Windows Subsystem for Linux) might technically run the binary, sensor data (especially thermal and fan control) is often virtualized or inaccessible in WSL, leading to "unavailable" states. On macOS, the kernel APIs are fundamentally different; porting this script would require a complete rewrite, effectively creating a new tool.
Do not open issues regarding Windows/macOS compatibility. The project scope is strictly Linux-native.
The TUI uses fixed-width character boxing and precise ANSI escape sequences. This requires:
-
Monospaced Font
Proportional fonts (e.g., default system fonts in some terminals) will destroy the grid alignment. -
Minimum Resolution
The script enforces a minimum of 80 columns × 25 rows (2-column mode) or 40 columns × 45 rows (1-column mode). Below these thresholds, a warning banner is displayed and the dashboard is suppressed. -
UTF-8 Support
The UI uses Unicode box-drawing characters (╭, ╮, │, ─) and block elements (▇, ❘). If your terminal locale is not UTF-8, these render as squares or question marks.
If you resize the terminal window dynamically, the script attempts to adapt via per-frame dimension reads, but rapid resizing can cause momentary "ghosting." The script does not support terminal emulators that fail to correctly report dimensions via tput.
- Switch to a monospaced font (e.g., JetBrains Mono, Fira Code, Hack).
- Ensure your terminal meets the minimum size requirements.
- Set
LC_ALL=en_US.UTF-8or an equivalent UTF-8 locale in your environment.
Modern Linux kernels and hardware manufacturers do not guarantee standardized sensor paths.
-
Thermal Sensors
The script scans/sys/class/hwmonfor specific driver names (k10temp,coretemp,zenpower). If your motherboard uses a proprietary or obscure controller, the path may not match the heuristic scan. The script also probesthermal_zoneentries forx86_pkg_tempas a fallback. -
Fans
Many laptops hide fan control behind ACPI tables rather than exposing them in/sys/class/hwmon. A reading of 0 RPM is treated as "inactive" (fan off or passive cooling), not "broken." -
Battery
TheBATTERY_IDdefaults toBAT1. If your system usesBAT0or a non-standard ID, the battery block will fail. -
NVMe
The script looks for anhwmonentry whose name contains "nvme" and readstemp1_input. Not all NVMe controllers expose this sysfs node.
Assuming a sensor is "broken" when it is simply "undiscovered" by the script's heuristics is a common user error. The script prioritizes safety: it displays "unavailable" rather than guessing and showing wrong data. A 3-second grace period (TEMP_ZERO_TIMEOUT) prevents flicker during transient 0 °C readings.
-
Inspect
/sys/class/hwmon/manually to find the correct sensor name and path. -
Edit the
CPU_TEMP_PATHorFAN_PATHvariables at the top of the script if you know the exact path. -
Change
BATTERY_IDto match your system (ls /sys/class/power_supply/). -
Verify that the
lm-sensorsandacpipackages are installed.
The script dynamically detects block devices using df -hP, filtering for sources starting with /dev/ while excluding /, /boot, /efi, and snap mount points. Re-detection occurs every 0.5 seconds to handle hot-plugging.
Storage detection (capacity, read/write I/O) is hardware-agnostic. NVMe, SATA HDDs, SATA SSDs, USB sticks, and SD cards are all treated identically — the script reads /proc/diskstats and df output, neither of which cares about the underlying bus interface. A mechanical SATA HDD will show capacity and I/O throughput just like an NVMe SSD.
-
Mount Point Mismatch
If you mount a drive to a custom path that thedffilter does not cover, it will be invisible. Network mounts (NFS, SMB) are excluded by design because they lack/dev/block device sources. -
Permission Issues
Reading/proc/diskstats,/sys/class/or/sys/block/requires read permissions. Running as a standard user might restrict access to certain block devices. Running as a standard user might restrict access to certain block devices, causing I/O speeds to show0.00. -
Hot-plugging Latency
The script re-scans mount points every 0.5 seconds. If a drive is inserted and ejected faster than this interval, it may be missed. -
Terminal Height
If the terminal is too short to accommodate additional drive boxes, drives are silently truncated and a warning banner is displayed.
Do not assume the script will "just work" with network mounts (NFS/SMB), encrypted volumes (LUKS) that are not yet unlocked, or RAID arrays with non-standard device naming. The script only tracks physical block devices exposed via /proc/diskstats.
- Mount external drives to standard locations.
- Run the script with sufficient permissions if
I/O speeds show 0.00(ensure read access to/sys/class/). - Use
--no-drivesto suppress external drive detection entirely if it causes issues. - Resize your terminal vertically to reveal hidden drives.
Temperature monitoring in SMD-TUI is exclusively NVMe-specific. The script searches for an hwmon entry whose name contains "nvme" and reads its temp1_input node:
nvme_hwmon_name=$(grep -il "nvme" /sys/class/hwmon/hwmon*/name 2>/dev/null | head -n 1)There is no code path for SATA HDD or SATA SSD temperature monitoring. The script does not invoke smartctl, hddtemp, or any other tool that could read temperatures from ATA/SCSI devices. This is a deliberate scoping decision, not an oversight.
This limitation is not tied to the root drive. NVME_TEMP_PATH is a single global variable set once at startup — it locks onto the first NVMe hwmon entry found, regardless of whether that drive is the root device, a secondary internal drive, or anything else. The absence of SATA temperature support is systemic, not positional.
Users may conflate "my drive shows no temperature" with "my drive is not detected at all." These are separate systems: storage detection (capacity, I/O) works for all interfaces; temperature detection works only for NVMe controllers that expose hwmon. If your NVMe controller does not expose temp1_input, even NVMe temperature monitoring will fail silently and show "unavailable."
-
Accept the limitation. If SATA HDD temperature is critical to your workflow, this script is not the right tool.
-
For NVMe drives showing "unavailable": verify that
cat /sys/class/hwmon/hwmon*/namecontains an entry withnvmeand that a correspondingtemp1_inputfile exists. -
Do not open issues requesting SATA/HDD temperature support. Adding it would require a new dependency (
smartmontoolsorhddtemp), which violates the project's zero-overhead philosophy.
-
Missing Dependencies
The script checks formpstat,iostat,bc, andawkat startup. If any are missing, it exits with a clear error message and suggests the correct package manager command. -
Bash Version
Requires Bash 4.0+ for associative arrays (used in stateful I/O tracking for external drives). Bash 3.x (found on legacy systems) will fail. -
Strict Mode
set -euo pipefailis intentionally commented out by default to enable graceful degradation. Enabling it will cause immediate exit on any minor error (e.g., a missing sensor file), which contradicts the design philosophy.
Running this script on a minimal container (e.g., Alpine without bash or coreutils) will result in immediate failure. The dependency check at startup catches mpstat, iostat, bc, and awk, but does not verify every optional path (e.g., /proc/pressure/memory or power-profiles-daemon).
- Verify Bash version:
bash --version. - Install missing packages:
sudo apt install sysstat bc gawk(or equivalent for your distro). - Run
./install.shwhich checks and guides dependency installation. - Do not enable
set -euo pipefailunless you have debugged every potential failure point in your specific environment.
The update interval is fixed at 0.5 seconds (hardcoded via read -r -t 0.5 -n 1 key).
Changing the update interval requires modifying the loop logic and will destabilize the delta calculations for I/O speeds. The * 2 multiplier in network and storage throughput math assumes a 0.5s interval.
To change the update rate, edit the read -r -t 0.5 line, but be aware that I/O delta math assumes a 0.5s interval. You must adjust the * 2 multiplier accordingly (e.g., for a 1.0s interval, change * 2 to * 1).
Supported via --accent-color [C] (blue, cyan, gray, green, orange, purple, red). The default is no accent color. However, the alert colors (red/yellow/green for thresholds) are hardcoded to ensure visibility regardless of terminal theme.
Modifying the color logic manually can lead to poor contrast (e.g., yellow text on a white background) or loss of critical alert visibility. The current palette is chosen for maximum legibility in low-light terminal environments.
Use the --accent-color flag for theme customization.
-
CPU Overhead
Negligible (<1% on modern CPUs). It uses native/procand/sysreads, not heavy polling or subshells for critical-path data gathering. -
Stability
The script runs in a tightwhile trueloop with a 0.5s sleep. If the terminal disconnects (SSH drop), theSIGINT/SIGTERMtrap should terminate it cleanly, but orphaned processes are possible if the signal is not delivered. -
Permissions
It only reads public kernel stats. It does not write to any system files or modify system state. -
Privacy
No telemetry is sent anywhere. All data is local.
While safe, running any monitoring tool on a production server adds a variable. If the script enters an infinite loop due to an unhandled edge case, it could consume a small amount of CPU. Always test in a staging environment first.
Safe for production use, provided you accept the risk of running custom scripts. Do not run it as a systemd service unless you wrap it with a proper restart policy. For long-running sessions, consider running inside tmux or screen to survive SSH disconnects.
Incorrect Reports (will be closed)
-
"It doesn't work on Windows."
See: Does this script support Windows or macOS? -
"My fan speed is 0."
Check your hardware documentation; many fans are not exposed to the OS or CPUs are passively cooled. Your operating system might run as a virtual machine. -
"The colors look weird."
Check your terminal font, palette, and background contrast. -
"My SATA HDD has no temperature." (See: Why does my SATA HDD show no temperature? — this is by design.)
-
Screenshots without terminal logs or system specs.
Correct Report Format
-
System Info
Distribution, kernel version (uname -r), Bash version (bash --version). -
Hardware
CPU model, motherboard model (crucial for sensor issues). -
Steps to Reproduce
Exact command used, including flags. -
Logs
Output ofbash -x smd-tui(debug mode) if the script crashes. -
Expected vs. Actual
Clear description of the discrepancy.
Final Note
This is a defensive tool. If your system behaves unexpectedly, the fault often lies in the hardware abstraction layer of your Linux distribution, not the script itself. Investigate your /sys and /proc trees before blaming the code.
You are. This script is provided "as is" under the MIT License with no warranty whatsoever. As a user, you are solely responsible for your own data and, where applicable, for any customer or third-party data stored on the system this script manages.
If your system handles critical or regulated data, implement your own backup and redundancy strategy. See LICENSE and the DISCLAIMER section in README.md for the full legal text.
Yes, under the terms of the MIT License. If you do, keep version numbers and build dates consistent across all files (see README.md — Version Metadata) to avoid breaking the test suite (test.sh).
Last updated: 22 August 2026 Author: RML Tec Dev