Universal Bash script for gathering system information and performing safe hardware tests on Linux hosts.
This script reports hardware details and performs basic stress tests on CPU, RAM, disk I/O, and temperature, with logging and automatic dependency installation.
- Operating system and version
- CPU model, cores, thread count
- RAM total and usage
- Disk information (model, size, mount points)
- Network interfaces (name, MAC, IP)
- Virtualization detection
- Software and hardware RAID detection
- Quick Test — short CPU and RAM test
- Full Test — Quick plus disk read test (safe)
- RAM Integrity Test — using
memtester - Thermal Stress Test — CPU stress with temperature monitoring
All output is captured into a log file under /var/log with timestamp for audit and support.
The script auto-detects the package manager and installs missing tools:
lm-sensorsmemtesterstress-ngpciutils
Support for:
aptdnfyumzypper
$ ./stress.sh
Log file: /var/log/hw_diagnostics_20260110_153045.log
...- Linux system with Bash
- Must run as root to install dependencies and access hardware information
Clone the repository:
git clone https://github.com/bazzelio/stress-test.git
cd stress-test/linux-hw-diagnostics
chmod +x stress.shRun the script:
./stress.shor explicitly with Bash:
bash stress.shDo not use:
sh stress.sh # Not supported1) Quick test
2) Full test
3) RAM integrity test
4) Thermal stress test
5) Exit
Choose the test you need from the interactive menu.
- Disk read-only test — does not modify data
- RAM integrity test is live, not boot-time memtest
- Stress tests may heat CPU — thermal tests stop on reaching temperature limits
- Recommended to run in a maintenance window on production systems
All outputs and test results are logged:
/var/log/hw_diagnostics_YYYYMMDD_HHMMSS.log
This log is helpful for:
- Support requests
- Incident analysis
- Automation and parsing
Works on most Linux distributions, including:
- Debian / Ubuntu
- CentOS / RHEL / AlmaLinux / Rocky
- openSUSE
- Bare-metal servers
- Virtual Machines
- Online RAM tests are not as thorough as boot-time memtest86
- Long SMART disk tests are not included to avoid long delays
- Hardware RAID health depends on vendor utilities
Contributions are welcome. Please fork the repository and open a pull request.
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).
You are free to:
-
use
-
modify
-
redistribute
under the terms of the GNU GPL.
See the LICENSE file for details.
BazzTech / bazzelio