s-tui是一个免费且开源监控计算机cpu的命令行ui工具。可以实时监控计算机cpu的温度,频率等并且以图形化的方式展示。这是一个python工具,可以直接使用pip安装,但是这是需要root权限的,可在ssh登陆的情况下直接以图形化方式监控cpu状态。

  1. 安装s-tui
  2. 使用s-tui

安装s-tui

s-tui可以直接pip安装,可安装的一个包stress,可以用于压力测试。

pip install stress
pip install s-tui
#Collecting s-tui
#  Downloading https://files.pythonhosted.org/packages/f4/43/d02518a7a3c178b04adbc813ed0959c7d89bff0fd6921286bb431de5649a/s-tui-0.8.3.tar.gz
#Collecting urwid>=1.3.1 (from s-tui)
#  Downloading https://files.pythonhosted.org/packages/45/dd/d57924f77b0914f8a61c81222647888fbb583f89168a376ffeb5613b02a6/urwid-2.1.0.tar.gz (630kB)
#     |████████████████████████████████| 634kB 1.5MB/s 
#Requirement already satisfied: psutil>=5.2.0 in /home/ztb/anaconda3/lib/python3.6/site-packages (from s-tui) (5.6.3)
#Building wheels for collected packages: s-tui, urwid
#  Building wheel for s-tui (setup.py) ... done
#  Created wheel for s-tui: filename=s_tui-0.8.3-cp36-none-any.whl size=43460 sha256=1959027585620b2d65da1fd1f03261a6b54972315b5ba0292c11c289746433b6
#  Stored in directory: /home/ztb/.cache/pip/wheels/3e/25/98/b0999024f1cba804214627f38d1dccaaa7f6b6e0dfefa429e4
#  Building wheel for urwid (setup.py) ... done
#  Created wheel for urwid: filename=urwid-2.1.0-cp36-cp36m-linux_x86_64.whl size=239992 sha256=17f6178b46285b3d1d22dfd9796e9259eaecfd254c7ac496fe632ca40f0f5bf8
#  Stored in directory: /home/ztb/.cache/pip/wheels/49/b5/ad/7355506059779337473b8eeb49384c9c0a9d45d34c8211a96d
#Successfully built s-tui urwid
#Installing collected packages: urwid, s-tui
#Successfully installed s-tui-0.8.3 urwid-2.1.0

使用s-tui

s-tui帮助信息

s-tui --help
#usage: s-tui [-h] [-d] [--debug-file DEBUG_FILE] [-dr] [-c]
             [--csv-file CSV_FILE] [-t] [-j] [-nm] [-v] [-ct CUSTOM_TEMP]
             [-tt T_THRESH] [-cf CUSTOM_FAN]

#TUI interface:

#The side bar houses the controls for the displayed graphs.
#At the bottom of the side bar, more information is presented in text form.

#* Use the arrow keys or 'hjkl' to navigate the side bar
#* Toggle between stressed and regular operation using the radio buttons in 'Modes'.
#* If you wish to alternate stress defaults, you can do it in 'Stress options'
#* Select a different temperature sensors from the 'Temp Sensors' menu
#* Change time between updates using the 'Refresh' field
#* Use the <Reset> button to reset graphs and statistics
#* Toggle displayed graphs by selecting the [X] check box
#* If a sensor is not available on your system, N/A is presented
#* If your system supports it, you can use the utf8 button to get a smoother graph
#* Press 'q' or the <quit> button to quit

#* Run `s-tui --help` to get this message and additional cli options

#optional arguments:
#  -h, --help            show this help message and exit
#  -d, --debug           Output debug log to _s-tui.log
#  --debug-file DEBUG_FILE
#                        Use a custom debug file. Default: _s-tui.log
#  -dr, --debug_run      Run for 5 seconds and quit
#  -c, --csv             Save stats to csv file
#  --csv-file CSV_FILE   Use a custom CSV file. Default: s-tui_log_<TIME>.csv
##  -t, --terminal        Display a single line of stats without tui
#  -j, --json            Display a single line of stats in JSON format
#  -nm, --no-mouse       Disable Mouse for TTY systems
#  -v, --version         Display version
#  -ct CUSTOM_TEMP, --custom_temp CUSTOM_TEMP
#                        Custom temperature sensors.
#                        The format is: <sensors>,<number>
#                        As it appears in 'sensors'
#                        e.g
#                        > sensors
#                        it8792-isa-0a60,
#                        temp1: +47.0C
#                        temp2: +35.0C
#                        temp3: +37.0C
#                        
#                        use: -ct it8792,0 for temp 1
#                            
#  -tt T_THRESH, --t_thresh T_THRESH
#                        High Temperature threshold. Default: 80
#  -cf CUSTOM_FAN, --custom_fan CUSTOM_FAN
#                        Similar to custom temp
#                        e.g
#                        >sensors
#                        thinkpad-isa-0000
#                        Adapter: ISA adapter
#                        fan1:        1975 RPM
#                        
#                        use: -cf thinkpad,0 for fan1
#

使用s-tui

s-tui

s-tui