A crucial factor in assessing the health of a Linux distribution or the hardware it operates on is the performance of the system. Depending on your objectives, there are various specialized tools available for tracking different aspects like CPU frequency, temperature, and memory usage. However, if you have a preference for the command-line interface (CLI), you might find working with S-TUI quite enjoyable.
S-TUI, short for Stress-Terminal UI, allows you to monitor CPU temperature, frequency, power usage, and utilization all at once. This utility visually presents all the relevant data and even enables the export of information into CSV files. What’s even more useful is the ability to set up S-TUI to automatically trigger scripts when any of the monitored components’ values exceed the defined thresholds. When combined with ‘stress,’ another command-line tool, S-TUI can also serve for putting your system through a stress-testing process.
S-TUI Install
In the terminal, update the available software repositories, install the Python 3, S-TUI and run the tool:
root@linuxVM$ sudo apt update
root@linuxVM$ sudo apt install python3-pip
root@linuxVM$ sudo pip install s-tui
root@linuxVM$ s-tui
Differing from numerous other command-line utilities, S-TUI doesn’t demand any configuration, allowing you to start utilizing it right after it’s installed.
How to use S-TUI
At the upper part of the left sidebar, you’ll find information about your CPU. Our Lenovo test system was accurately recognized as having an Intel Core i3-5005U CPU @ 2.00GHz processor. S-TUI achieves this by employing several other built-in tools and utilities to collect the pertinent data. As an example, you can extract the same information and even more detailed specifics by executing the command cat /proc/cpuinfo.
Upon your initial launch of S-TUI, it presents all four parameters – Frequency, Utilization, Temperature, and Power – and updates the data for each parameter every two seconds.
To adjust the refresh rate from two seconds to 0.1, modify the value of Refresh[s]:2.0 on the sidebar to 0.1. Keep in mind that this adjustment might exert additional load on your machine.
You can navigate the sidebar using the up and down arrow keys. Additionally, S-TUI supports the utilization of H and J keys for scrolling, similar to the scrolling function in Vim. Mouse input is also compatible with S-TUI.
S-TUI comes with a default configuration that solely monitors your system. To thoroughly challenge our machine’s capabilities, we incorporated “stress,” a stress-testing terminal tool. “Stress” is compatible with a wide range of CPUs, and we employ it to perform stress tests on Linux systems.
Install stress test profile
To install stress, open a terminal and enter the following.
root@linuxVM$ sudo apt install stress
root@linuxVM$ s-tui
Utilize the arrow keys to navigate to the “Stress” option and then press the spacebar. Alternatively, you can also choose this option using the mouse. As you do this, you’ll observe the CPU graphs swiftly refreshing, displaying the current temperature, frequency, and utilization of the processor. The stress test will continue to run indefinitely.
Stress Test Your CPU in Linux
To conclude the stress test, move to the Monitor section and press the spacebar or simply click using your mouse.
For a stress test with a predefined time limit, access the Stress Options section and modify the Time out to your preferred duration (in seconds). Adjust the Sqrt() worker count to align with the number of cores on your CPU. After making the changes, click the Save button.
Navigate to the Stress section and press the spacebar to initiate the timed test. In this instance, we’ve chosen a 30-second duration and maintained a worker count of 4.
Saving Your Test Results
The gathered data gets erased once you exit S-TUI, as the tool doesn’t have default saving capabilities.
To enable automatic saving of the collected data into a timestamped CSV file upon exiting S-TUI, use the following command:
Linux$ s-tui -c
If you wish to use your own filename, employ the command with the “–csv-file” option followed by your desired filename:
root@linuxVM$ s-tui --csv-file <name of file>.csv
For those who prefer data in JSON format, it’s possible to generate JSON output for the current status. However, this doesn’t create a continuous log of data:
root@linuxVM$ s-tui -j
Maciej Zytowiecki
Network security expert with a deep passion for wireless networks, networking and data security. When I'm not working, you'll find me diving into hobby projects, contributing to open-source initiatives, or enjoying hands-on experiments with cutting-edge tech. My goal is to bridge the gap between complex concepts and accessible knowledge, making the world of network security both intriguing and approachable for all.