Code Monkey home page Code Monkey logo

bashtop's Introduction

bashtop

Linux OSX FreeBSD Usage Bash Python bashtop_version Build Status Donate Sponsor Coffee

C++ Version

18 September 2021

btop++

The C++ version of bashtop - btop++ is available.

Get it at https://github.com/aristocratos/btop

Index

Documents

Description

Resource monitor that shows usage and stats for processor, memory, disks, network and processes.

Features

  • Easy to use, with a game inspired menu system.
  • Fast and "mostly" responsive UI with UP, DOWN keys process selection.
  • Function for showing detailed stats for selected process.
  • Ability to filter processes.
  • Easy switching between sorting options.
  • Send SIGTERM, SIGKILL, SIGINT to selected process.
  • UI menu for changing all config file options.
  • Auto scaling graph for network usage.
  • Shows message in menu if new version is available
  • Shows current read and write speeds for disks
  • Multiple data collection methods which can be switched if running on Linux

Themes

Bashtop now has theme support and a function to download missing local themes from repository.

See themes folder for available themes.

The builtin theme downloader places the default themes in $HOME/.config/bashtop/themes. User created themes should be placed in $HOME/.config/bashtop/user_themes to be safe from overwrites.

Let me know if you want to contribute with new themes.

Support and funding

Bug fixes and updates might be slow during normal workdays since I work full time as an industrial worker and don't have much time or energy left during the week. I'm looking into ways of funding this project that would allow me to take off time from my day job to work on this.

Any advice on how to get funding for open source projects is very welcome!

Update

You can now sponsor this project through github, see my sponsors page for options.

Also added donation links for paypal and ko-fi.

Any support is greatly appreciated!

Prerequisites

Mac Os X

Will not display correctly in the standard terminal! Recommended alternative iTerm2

Will also need to be run as superuser to display stats for processes not owned by user.

Linux, Mac Os X and FreeBSD

For correct display, a terminal with support for:

Also needs a UTF8 locale and a font that covers:

  • Unicode Block “Braille Patterns” U+2800 - U+28FF
  • Unicode Block “Geometric Shapes” U+25A0 - U+25FF
  • Unicode Block "Box Drawing" and "Block Elements" U+2500 - U+259F

Notice

Dropbear seems to not be able to set correct locale. So if accessing bashtop over ssh, OpenSSH is recommended.

Dependencies

Linux, OSX and FreeBSD

bash (v4.4 or later) Script functionality will most probably break with earlier versions. Bash version 5 is highly recommended to make use of $EPOCHREALTIME variable instead of a lot of external date command calls.

GNU coreutils

GNU sed

Linux using /proc for data collection

GNU grep

ps from procps-ng (v3.1.15 or later)

GNU awk

OSX and FreeBSD or Linux using psutil for data collection

Python3 (v3.6 or later)

psutil python module (v5.7.0 or later)

Optionals for additional stats

(Optional OSX) osx-cpu-temp Needed to show CPU temperatures.

(Optional Linux) lm-sensors Needed to show CPU temperatures.

(Optional Linux) iostat (part of sysstat) Needed if you want disk read/write stats and are not using psutil data collection.

(Optional OSX/Linux/FreeBSD) curl (v7.16.2 or later) Needed if you want messages about updates and the ability to download themes.

Screenshots

Main UI showing details for a selected process. Screenshot 1

Main menu. Screenshot 2

Options menu. Screenshot 3

Installation

Dependencies installation OSX

Install homebrew if not already installed

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

If you got python 3.6 or later installed outside of brew:

sudo python3 -m ensurepip
sudo python3 -m pip install psutil

If you haven't got python3 installed:

brew install python3
python3 -m pip install psutil

Install dependencies

brew install bash coreutils gnu-sed git

Install optional dependency osx-cpu-temp

brew install osx-cpu-temp

Dependencies installation FreeBSD

Install with pkg and pip

sudo pkg install coreutils gsed git py37-psutil

Manual installation Linux, OSX and FreeBSD

Clone and install

git clone https://github.com/aristocratos/bashtop.git
cd bashtop
sudo make install

to uninstall it

sudo make uninstall

FreeBSD package

Available in FreeBSD ports

Install pre-built pacakge

sudo pkg install bashtop

Arch based

Available in the AUR as bashtop-git

Available in the Arch Linux repository as bashtop

Debian based

Available in official Debian repository since Debian 11

Available for debian/ubuntu from Azlux's repository

Or use quick installation:

Quick install go to DEB folder and type

 sudo ./build

to uninstall it go to DEB folder and type

 sudo ./build --remove

Guix based

Available in official Guix repository since 6bbd0fd2

Installation

guix install bashtop

Ubuntu based

Available in official Ubuntu repository since Ubuntu 20.10

Available for Ubuntu from PPA repository

Add PPA repository and install bashtop

 sudo add-apt-repository ppa:bashtop-monitor/bashtop
 sudo apt update
 sudo apt install bashtop

Fedora

Available in the Fedora repository.

Installation

sudo dnf install bashtop

CentOS 8

Installation

dnf config-manager --set-enabled PowerTools
dnf install epel-release
dnf install bashtop

RHEL 8

Installation

ARCH=$( /bin/arch )
subscription-manager repos --enable
"codeready-builder-for-rhel-8-${ARCH}-rpms"
dnf install epel-release
dnf install bashtop

Configurability

All options changeable from within UI. Config files stored in "$HOME/.config/bashtop" folder

bashtop.cfg: (auto generated if not found)

#? Config file for bashtop v. 0.9.21

#* Color theme, looks for a .theme file in "$HOME/.config/bashtop/themes" and "$HOME/.config/bashtop/user_themes"
#* Should be prefixed with either "themes/" or "user_themes/" depending on location, "Default" for builtin default theme
color_theme="Default"

#* Update time in milliseconds, increases automatically if set below internal loops processing time, recommended 2000 ms or above for better sample times for graphs
update_ms="2500"

#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu responsive"
#* "cpu lazy" updates sorting over time, "cpu responsive" updates sorting directly
proc_sorting="cpu lazy"

#* Reverse sorting order, "true" or "false"
proc_reversed="false"

#* Show processes as a tree
proc_tree="false"

#* Check cpu temperature, only works if "sensors", "vcgencmd" or "osx-cpu-temp" commands is available
check_temp="true"

#* Draw a clock at top of screen, formatting according to strftime, empty string to disable
draw_clock="%X"

#* Update main ui when menus are showing, set this to false if the menus is flickering too much for comfort
background_update="true"

#* Custom cpu model name, empty string to disable
custom_cpu_name=""

#* Enable error logging to "$HOME/.config/bashtop/error.log", "true" or "false"
error_logging="true"

#* Show color gradient in process list, "true" or "false"
proc_gradient="true"

#* If process cpu usage should be of the core it's running on or usage of the total available cpu power
proc_per_core="false"

#* Optional filter for shown disks, should be names of mountpoints, "root" replaces "/", separate multiple values with space
disks_filter=""

#* Enable check for new version from github.com/aristocratos/bashtop at start
update_check="true"

#* Enable graphs with double the horizontal resolution, increases cpu usage
hires_graphs="false"

#* Enable the use of psutil python3 module for data collection, default on OSX
use_psutil="true"

Command line options: (not yet implemented)

USAGE: bashtop

TODO

Might finish off items out of order since I usually work on multiple at a time.

  • Add options to change colors for text, graphs and meters.

  • Fix cross platform compatibility for Mac OSX and *BSD: Working on OSX, and FreeBSD.

  • Add support for showing AMD cpu temperatures.

  • Add option to show tree view of processes.

  • Add option to reset network download/upload totals.

  • Add option to turn of gradient in processes list.

  • Add gpu temp and usage. (If feasible)

  • Add io stats for disks.

  • Add cpu and mem stats for docker containers. (If feasible)

  • Change process list to line scroll instead of page change.

  • Add optional window for tailing log files.

  • Add options for resizing all boxes.

  • Add command line argument parsing.

  • Builtin updater. Relevant PR #96 by Jukoo

  • Add support for zram in memory box. Relevant PR #122 by perkinslr

  • Miscellaneous optimizations and code cleanup.

  • Add more commenting where it's sparse.

  • Python port. (Porting started)

LICENSE

Apache License 2.0

bashtop's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bashtop's Issues

[REQUEST] Add support for zenpower or k10temp

Is your feature request related to a problem? Please describe.
This is super slick, but it'd be cool if the sources for temperatures were expanded to support zenpower for newer Ryzen CPU's

Describe the solution you'd like
Here's the relevant section of sensors output for zenpower:

zenpower-pci-00c3
Adapter: PCI adapter
SVI2_Core: 1.40 V
SVI2_SoC: 1.08 V
Tdie: +65.6°C (high = +95.0°C)
Tctl: +65.6°C
Tccd1: +64.8°C
Tccd2: +50.2°C
SVI2_P_Core: 27.55 W
SVI2_P_SoC: 13.69 W
SVI2_C_Core: 20.42 A
SVI2_C_SoC: 12.65 A

Describe alternatives you've considered
If you're open to pull requests, I can work on adding support for this tomorrow. Just reply to this issue if you want me to take a stab at it.

Additional context
This is a wonderful project. I almost want to just run it in a plasma applet and have it be my background! Nice work!

[BUG] Color theme numbering is wrong without additional themes

When using bashtop without additional color themes, the Default theme is used but its numbering in the Options menu is wrong: "Color theme: 2/1".

Steps to reproduce the behavior:
Delete or empty the ~/.config/bashtop/themes directory. Launch bashtop and display the Options menu (either by Esc + Options menu selection or by o shortcut).

Expected behavior:
When displaying the Options menu, the numbering should read: "Color theme: 1/1".

Info:

  • Linux distribution and version: Ubuntu 19.10
  • Bash version: 5.0.3(1)-release

[BUG] Pause/Option menu incompatibilities with the French locale (?).

Describe the bug
Strange-looking output of the option/pause menu on yakuake.

To Reproduce

  1. Use Yakuake to launch bashtop
  2. Press Echap by default to activate the pause/option menu.
  3. Notice that it render the output pretty weirdly.

Expected behavior
Correctly displayed ASCII menu entries.
The darkening background isn’t showing up the same as displayed on the screenshot as well, but I don’t consider it as an issue.

Screenshots
Peek 2020-04-24 12-19
(Ignore the flickering at the top, It’s due to the https://github.com/phw/peek capture. I don’t know what to use for recording things like I was doing with ShareX before)

Info (please complete the following information):

  • Linux distribution and version
                   -`                    pm@VIX
                  .o+`                   ------
                 `ooo/                   OS: Arch Linux x86_64
                `+oooo:                  Kernel: 5.6.6-13-tkg-bmq
               `+oooooo:                 Uptime: 3 hours, 33 mins
               -+oooooo+:                Packages: 1943 (pacman)
             `/:-:++oooo+:               Shell: bash 5.0.16
            `/++++/+++++++:              Resolution: 3440x1440
           `/++++++++++++++:             DE: Plasma
          `/+++ooooooooooooo/`           WM: KWin
         ./ooosssso++osssssso+`          WM Theme: Layan
        .oossssso-````/ossssss+`         Theme: Layan [Plasma], Layan-dark [GTK2/3]
       -osssssso.      :ssssssso.        Icons: korla [Plasma], korla [GTK2/3]
      :osssssss/        osssso+++.       Terminal: yakuake
     /ossssssss/        +ssssooo/-       CPU: AMD Ryzen 5 3600X (12) @ 3.800GHz
   `/ossssso+/:-        -:/+osssso+-     GPU: NVIDIA GeForce GTX 1060 6GB
  `+sso+:-`                 `.-/+oso:    Memory: 8369MiB / 32044MiB
 `++:.                           `-/+/
 .`                                 `/

  • System locale (output of “echo $LANG”)
    fr_FR.UTF-8 (us_US.UTF-8 also installed on my computer, for compatibility reasons)

  • Bash version

1 core/bash 5.0.016-1 (1.6 MiB 8.0 MiB) (Installed)
    The GNU Bourne Again shell

Out of topic notes
Discovered your resource monitor via one article of the NextInpact french news website, I absolutely love it!

[BUG] Not working / reporting errors when launched on Mac OS X

Hi,
I've just cloned the repo and tried to run it without any parameters on my Mac OS X system and it prints various errors and stops:

./bashtop
./bashtop: line 33: shopt: globasciiranges: invalid shell option name
./bashtop: line 33: shopt: globstar: invalid shell option name
./bashtop: line 112: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]

I'm using ZSH but bash is installed (and that shouldn't change much):

 bash --version                                                                                                                                   ─╯
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc.

Screenshot 2020-04-24 at 15 37 34
Screenshot 2020-04-24 at 15 39 39

[BUG] Misuse of . in regex comparison

Hi. I was still reading and found this one:

bashtop/bashtop

Line 732 in c910e2d

if [[ -n $int && $found =~ . ]]; then

[[ $foo =~ . ]] is actually [[ -n $foo ]].
I think what you wanted to meant was more [[ $foo =~ \. ]] or [[ $foo = *.* ]] (this form should be faster to run, iirc).

Since %.* is idempotent when there's no . in foo's value, another possiblity would be to drop that test and do that

if [[ -n $int ]]; then
    found=${found%.*}
    if [[ -n $math ]]; then
        math=...
        found=...
    fi
fi

[BUG] Crash on open for Ubuntu 16

Describe the bug
Logged into a few of our AWS Ubuntu 16 machines, and they would render the frames, then it would crash. If it's not supported, this should help you figure compatibility to list in the README.

Info (please complete the following information):

  • Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-1044-aws x86_64)
  • Lang: en_US.UTF-8
  • Bash version: GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)

Additional context
$HOME/.config/bashtop/error.log"

New instance of bashtop version: 0.8.3 Pid: 18459
04:49:12 AM ERROR: On line 724 
04:49:12 AM ERROR: On line 724 (MUTED!)
./bashtop: line 669: /sys/devices/system/cpu/cpu-1/cpufreq/scaling_cur_freq: No such file or directory
04:49:12 AM ERROR: On line 669 
04:49:12 AM ERROR: On line 682 
04:49:12 AM ERROR: On line 724 
04:49:12 AM ERROR: On line 724 (MUTED!)
./bashtop: line 1412: mem[available]*100/mem[total]: division by 0 (error token is "mem[total]")
error: improper AIX field descriptor

Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

For more details see ps(1).
04:49:12 AM ERROR: On line 1503 
./bashtop: line 669: /sys/devices/system/cpu/cpu-1/cpufreq/scaling_cur_freq: No such file or directory
04:49:12 AM ERROR: On line 669 
04:49:12 AM ERROR: On line 682 
./bashtop: line 914: local: `': not a valid identifier
04:49:12 AM ERROR: On line 914 
./bashtop: line 914: local: `': not a valid identifier
04:49:12 AM ERROR: On line 914 (MUTED!)
./bashtop: line 914: local: `': not a valid identifier
./bashtop: line 914: local: `': not a valid identifier
error: improper AIX field descriptor

Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

For more details see ps(1).
04:49:14 AM ERROR: On line 1503 
./bashtop: line 669: /sys/devices/system/cpu/cpu-1/cpufreq/scaling_cur_freq: No such file or directory
04:49:15 AM ERROR: On line 669 
04:49:15 AM ERROR: On line 682 
04:49:15 AM ERROR: On line 939 
04:49:15 AM ERROR: On line 939 (MUTED!)
./bashtop: line 1743: (Receive-Receive)*1000/(net[new_timestamp]-net[old_timestamp]) : division by 0 (error token is "(net[new_timestamp]-net[old_timestamp]) ")

[BUG] Bashtop not running without cpufreq

Describe the bug
Bashtop not running on OVH VPS. The problem is about cpufreq part.

To Reproduce
Run bashtop on linux without cpufreq module loaded.

Info (please complete the following information):

  • Last Ubuntu 16.04
  • OVH VPS

Log :
New instance of bashtop version: 0.8.4 Pid: 21402
09:18:30 PM ERROR: On line 724
09:18:30 PM ERROR: On line 724 (MUTED!)
./bashtop: line 669: /sys/devices/system/cpu/cpu-1/cpufreq/scaling_cur_freq: No such file or directory
09:18:37 PM ERROR: On line 669
09:18:37 PM ERROR: On line 682
09:18:37 PM ERROR: On line 724
09:18:37 PM ERROR: On line 724 (MUTED!)
./bashtop: line 1413: mem[available]*100/mem[total]: division by 0 (error token is "mem[total]")
./bashtop: line 669: /sys/devices/system/cpu/cpu-1/cpufreq/scaling_cur_freq: No such file or directory
09:18:38 PM ERROR: On line 669
09:18:38 PM ERROR: On line 682
./bashtop: line 914: local: ': not a valid identifier 09:18:38 PM ERROR: On line 914 ./bashtop: line 914: local: ': not a valid identifier
09:18:38 PM ERROR: On line 914 (MUTED!)
./bashtop: line 914: local: ': not a valid identifier ./bashtop: line 914: local: ': not a valid identifier
./bashtop: line 1565: ( ( 32372130-32371881 ) * 1000 * 1000 ) / ( cpu[hz]time_elapsedcpu[threads] ) : division by 0 (error token is "( cpu[hz]time_elapsedcpu[threads] ) ")

[BUG] Division by 0 at startup

Describe the bug
When launching bashtop an division by zero occur line 1590

Info (please complete the following information):

  • Linux distribution and version :
    Ubuntu Server 18.04 bionic

  • Bash version (version 4.4 or above is required) :
    version 4.4.20(1)-release

Additional context
error.log :

New instance of bashtop version: 0.8.14 Pid: 11032
10:51:33 ERROR: On line 666
/usr/bin/bashtop: line 1590: ( ( 6638-6530 ) * 1000 * 1000 ) / ( cpu[hz]*time_elapsed*cpu[threads] ) : division by 0 (error token is "( cpu[hz]*time_elapsed*cpu[threads] ) ")

Font coverage

Is there a guideline for what kind of fonts I would need to be able to see the usage bars and graphs?

Bashtop crashes when trying to launch

Hello there!
I just stumbled upon your project on Reddit!

I decided to try it out but, unfortunately, when trying to launch it, it crashes.
I have bash 5.0.3, and the terminal window is fullscreen.

When trying to launch bashtop, it just crashes/closes unexpectedly without giving out any message.

How can I fix this?

Please add tree view of processes

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when No tree view like with "V" option in top ot "T" in htop

Describe the solution you'd like
Want to view processes like in with pstree utility

Describe alternatives you've considered
options in top, pstree, htop, ps -f --forest, glances(old) option.
Additional context

[BUG] Issue on latest Proxmox + Fedora 30

Describe the bug
Seems to have an issue with lots of mounts / maybe ZFS?

To Reproduce
Run bashtop

Expected behavior
Prettyness

Screenshots
App exits after drawing the boxes with:
./bashtop: line 1171: -: syntax error: operand expected (error token is "-")

Info (please complete the following information):

  • Debian GNU/Linux 10 (buster
  • System locale: en_US.UTF-8
  • Bash version: GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu)

Additional context
New instance of bashtop version: 0.8.3 Pid: 33115
./bashtop: line 1171: -: syntax error: operand expected (error token is "-")

New instance of bashtop version: 0.8.3 Pid: 33612
./bashtop: line 1171: -: syntax error: operand expected (error token is "-")

New instance of bashtop version: 0.8.3 Pid: 36473
./bashtop: line 1171: -: syntax error: operand expected (error token is "-")

New instance of bashtop version: 0.8.3 Pid: 37120
git/bashtop/bashtop: line 1171: -: syntax error: operand expected (error token is "-")

New instance of bashtop version: 0.8.3 Pid: 37775
git/bashtop/bashtop: line 1171: -: syntax error: operand expected (error token is "-")

[REQUEST] add iotop stats

Describe the solution you'd like
It would be useful integrate also I/O stats, like iotop:

Additional context

image

[BUG] (minor) some window size expressed as WxH, some as HxW

E.g. starting bashtop on a slightly smaller window, I get
current size: 23x80 need to be at least 80x25
while I expect to see
current size: 80x23 need to be at least 80x25

And when resizing dynamically, the message box also uses HxW.

Better to stick to the more common WxH everywhere...

Cohesive Colorscheme [REQUEST]

Is your feature request related to a problem? Please describe.
Default colors could not match a user's color setup

Describe the solution you'd like
I would suggest trying to set the used colors based on a user's .Xresources file and if not, then fallback to the current colorscheme

Describe alternatives you've considered
None

Additional context
Hi @aristocratos

I wanted to say I think this is a very nice and fancy tool and I really like it.
I noticed you had this item on your TODO list I just thought I would give you an idea to consider in order to achieve it.

I could potentially come up with a PR if I can find some time, but in the meantime I just wanted to raise this as a feature request.

Thanks!

[BUG]

Current size: │
80x24
Need to be atleast:
80x25

crash on "Division by zero" error

bash from Debian Buster: GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu)

Started with and without .bashrc (bash --norc):

New instance of /usr/local/bin/bashtop Pid: 3983
01:00:00  ERROR: On line 611 01:00:00  ERROR: On line 615 01:00:00  ERROR: On line 186 /usr/local/bin/bashtop: line 1538: ( ( 829-829 ) * 1000 * 1000 ) / ( cpu[hz]*time_elapsed*cpu[threads] ) : division by 0 (error token is "( cpu[hz]*time_elapsed*cpu[threads] ) ")

[BUG] Disk used amount does not update

Describe the bug
When actual disk space is freed up, Free disk space is increased but Used space is not decreased (until bashtop is restarted).

To Reproduce

  • Run bashtop
  • Delete large file
  • Observer that Free changed but Used did not, resulting in them not adding up to 100

Expected behavior
Both should be updated in real time

Info (please complete the following information):

  • Ubuntu 20.04
  • 5.0.16(1)-release

Additional context
$HOME/.config/bashtop/error.log:

New instance of bashtop version: 0.8.13 Pid: 1914836
 
New instance of bashtop version: 0.8.13 Pid: 1916971
 
New instance of bashtop version: 0.8.13 Pid: 1918707

shopt: globasciiranges: invalid shell option name[BUG]

After I use "./bashtop",there is nothing in the screen
20200427115204.
when I use "ctrl+c"back to the desktop,it shows "shopt: globasciiranges: invalid shell option name".
I have tried delete "globasciiranges",still nothing in the screen.

Problem with mem a disks's chart

Hi, the cpu and net charts render fine, but mem and disks are not. I'm tested with gnome-terminal and xfce4-terminal. Should I install a new font?

image

Enhancement Request - NVIDIA GPU monitoring

First - this is one awesome tool! Thanks a million!

Second - I use NVIDIA GPUs, and I would love if monitoring them could be incorporated into bastop. The needed metrics are exposed in the either /proc or /sys.

Thank you!

Jeff Layton

[REQUEST] bashtop should fail gracefully if the Bash version is lower than 4.4

Is your feature request related to a problem? Please describe.

Yes. I tried bashtop on an Ubuntu 16.04 machine, which only has Bash 4.3. bashtop crashed a few seconds after starting, without displaying any error message. (It works fine on my other Fedora 31 machine, which has Bash 5.x.)

Describe the solution you'd like

bashtop should check the bash version and exit with a non-zero error code if the Bash version on the system is lower than 4.4.

I could look at implementing this if this feature is desired.

Describe alternatives you've considered

N/A

Additional context

N/A

[BUG] Freezing

Description
Bashtop freezes after trying to reverse, when additional info of pocess opened

To Reproduce

  1. Open Bashtop
  2. Press ↓ (down arrow)
  3. Press ↵ (enter)
  4. Press "r".
  5. It freezed!

Some info about test environment:
Manjaro Linux 20.0
Bash version 5.0.16
Linux kernel 5.6.7-1-MANJARO

Option to turn off gradient on process list

The gradient is really cool looking but it makes it a little hard to read the processes at the bottom. I really think it looks cool but I would like an option to turn it off.

[BUG] NET and CPU graph overwriting small box

Describe the bug
While running bashtop, the small CPU infobox is being overwritten by the main graph

Expected behavior
To work as in screenshots from readme

Screenshots
image

Info (please complete the following information):

  • Linux distribution and version - Debian buster
  • System locale (output of "echo $LANG") - en_US.UTF-8
  • Bash version - bash 5.0 (x86_64-debian-linux-gnu)

Additional context
$HOME/.config/bashtop/error.log":

 
New instance of bashtop version: 0.8.3 Pid: 6266

[REQUEST] Add GPU usage

Is your feature request related to a problem? Please describe.
GPU Memory and Core is currently not displayed

Describe the solution you'd like
Something that either shows the recent history of GPU usage, or current GPU usage

Describe alternatives you've considered
Currently using https://github.com/Syllo/nvtop, the same could be looked at being integrated

Additional context
Awesome project!

Support for Centos

Hi, how are you?. Im running Centos 7.8 for first time, im using bashtop in Debian and work perfectly, but in Centos Im have the next problem when im running ./bashtop:

./bashtop: line 33: shopt: globasciiranges: invalid shell option name

Im install all dependencies but not work, could you help me please?. Regards!

[BUG] when parsing --dimensions, $5 value is not verified.

I have not run the program, i was just reading the source code.

I think you made a booboo:

-d|-dimensions) if [[ $2 =~ ^[0-9]+$ && $3 =~ ^[0-9]+$ && $3 =~ ^[0-9]+$ && $4 =~ ^[0-9]+$ ]]; then 				#? Graph dimensions
		line=$2; col=$3; height=$4; width=$5; shift 4; fi;;

You're testing $3 value twice, and you're not testing $5.

Also, since you're using it a lot, you could actually refactor that test a function, it would improve readability:

_all_int() {
    local param
    for param; do
        [[ $param =~ ^[0-9]+$ ]] || return
    done
}

For --dimensions parsing, you can call it like this:

if _all_int "${@:2:4}"; then line=$2 ... ; shift 4 ; fi ;;

Is it working on LXC

Hi,
I trying your project into a LXC container.
I have this error :

New instance of bashtop version: 0.6.11 Pid: 25782
10:49:43 PM ERROR: On line 180
./bashtop: line 1292: ( 100*(60649195923-60649210126-+) ) / (60649195923-60649210126) : syntax error: operand expected (error token is ") ) / (60649195923-60649210126) ")
10:49:44 PM ERROR: On line 385

Try with : GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu)

Here is tracing.log file (it's quite huge):
tracing.log

[BUG] many versions of procps-ng fail to support "thcount" field (alias)

Describe the bug
Processes are not listed when using procps-ng 3.3.10.

To Reproduce
Run bashtop.

Expected behavior
Process list is filled.

Screenshots

Info (please complete the following information):

  • Linux distribution and version:
    Fedora 27
  • System locale (output of "echo $LANG")
    en_US.UTF-8
  • Bash version
    $ echo $BASH_VERSION
    4.4.23(1)-release
    $ rpm -q bash
    bash-4.4.23-1.fc27.x86_64

Additional context

02:09:10 AM ERROR: On line 1529 
error: improper AIX field descriptor

Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

For more details see ps(1).

As described in #12:

Looking at the error.log there are indications of errors from output of "ps". Could be a version incompatibility there too, but if so, it will be fixed in the next big update where python psutil will be used instead.

As I just encountered this, I had a closer look. Debugging the ps command line, it turned out that my version of ps choked on the "thcount" format specifier.

This specifier is an alias for "nlwp". It seems it got lost in version 3.3.0 of procps-ng, and re-appeared in 3.3.12:
https://bugzilla.redhat.com/show_bug.cgi?id=1174313
https://gitlab.com/procps-ng/procps/-/blob/master/NEWS#L112
Commit breaking:
https://gitlab.com/procps-ng/procps/-/commit/0e6ac0db3e35fbf0eca0c02d09540ca6fb0ba77c
Commit fixing:
https://gitlab.com/procps-ng/procps/-/commit/3a52dfa340276a7f8f55af1b8267392ee48988b9
(That's five years, 12 versions "broken". Wow.)

"thcount" has always been an alias for "nlwp", since they were introduced in 3.1.15, so using "nlwp" instead is always guaranteed to work, and would fix the issue for procps-ng from 3.3.0 to 3.3.11. It works for me with patched bashtop + procps-ng 3.3.10.

List all dependencies on README

On README, it says that it only requires Bash, then tells it also requires date command on previous versions, which isn't a Bash builtin.

I looked for external commands and I found these dependencies:

  • ncurses binaries (tput...), but these should be on any Linux distribution by default (required by bash package on Arch, "required" package on Debian, not so sure for Alpine though)
  • GNU Coreutils (date...), for example busybox date ignores %N if that matters
  • procps (ps) - for example it's clearly not compatible with busybox ps

There may be more.

[BUG] Text scrolling off the screen.

Describe the bug
As the screen refreshes, a few lines (CPU Core 2 utilization and total Bytes uploaded) move to the right with each refresh.

To Reproduce
Steps to reproduce the behavior: Difficult to say. It's always done this on my setup. The Linux machine I'm monitoring is a VM. The host machine from which I access that machine is using the SSH plugin on Google Chrome.

Expected behavior
The two lines mentioned above should stay aligned with the rest of the information on the screen upon refresh.

Screenshots
Capture

Info (please complete the following information):

  • EndeavourOS Linux x86_64 Kernel: 5.6.5-arch3-1
  • GNU bash, version 5.0.16(1)-release (x86_64-pc-linux-gnu)

[BUG] Input lag

Describe the bug
When using arrow keys to navigating the processes there is a small delay. When viewing info for a process the delay is increased.

To Reproduce
Simply clone and run bashtop

Info:

  • Fedora 31, Linux 5.5.16-200.fc31.x86_64
  • Bash version 5.0.11

Additional context

Using default config and no errors.

[BUG] High CPU usage

Describe the bug
On my machine, bashtop often goes up to 50% of CPU usage on refreshes.

To be exact, it varies between 20% and 60% of CPU usage according to htop. Computed by itself, it doesn't go upper than 4% of CPU (different CPU usage calculation?).

I increased refresh delay up to 5s to reduce CPU usage, so that happens less.

To Reproduce
Steps to reproduce the behavior:

  1. Launch bashtop

  2. Observe CPU usage on refreshes

  3. Decrease refresh delay (2s shows high CPU usage nearly constantly)

Expected behavior
Lower CPU usage.

I still find 15%-20% would be still high, but more acceptable.

Cf. tests on another machine below.

Screenshots

  PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
31145 root       20   0  217M  6896  2416 S 40.4  0.0  0:28.97 bash /usr/local/bin/bashtop

Info (please complete the following information):

  • Gentoo Linux 5.0.5
  • Bash v5.0.17
  • 4c/[email protected] CPU
  • ZFS root with 39 volumes mounted (is disk monitoring CPU intensive?)

Additional context

Error logs:

Here are my latest error logs (please note that I upgraded bashtop before further testing and opening this issue):

New instance of bashtop version: 0.8.5 Pid: 1651
09:44:08 ERROR: On line 1731 
09:44:11 ERROR: On line 1731 (MUTED!)
 
New instance of bashtop version: 0.8.15 Pid: 30665
 
New instance of bashtop version: 0.8.15 Pid: 31145

Version comparison:

Compared to 0.8.5, CPU usage is lower on latest version (didn't reach 50% as far as I've seen), it's more between 20% to 40%

Tests on another machine:

On a remote 6c/[email protected] remote machine (bash v4.4.23, Gentoo Linux 5.3.7, no ZFS and 2 volumes), CPU usage on htop varies between 4% and 25% as I've seen.

This latest CPU usage sounds reasonable for me, if there's tweaks I can do on my main host I'd like to target this CPU usage. Is my 40%-50% CPU usage locally kind of common for bashtop or is it abnormal?

Side note
Thanks for your amazing work! (#59)

Fails to run

I don't have time this afternoon to investigate. Saw the post on reddit and thought I'd give it a quick try. Immediately errors and exits.

error.log:

New instance of ./bashtop Pid: 25873
./bashtop: line 158: 1586128712.082293/1000: syntax error: invalid arithmetic operator (error token is ".082293/1000")
./bashtop: line 158: 1586128712.083603/1000: syntax error: invalid arithmetic operator (error token is ".083603/1000")

bash version

> bash --version
GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Distro info

> lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 19.10
Release:	19.10
Codename:	eoan

[BUG] Load average view is clipped

Describe the bug
The brand new load average feature clips through the right-hand side of my terminal back into the left

To Reproduce
Steps to reproduce the behavior:
Run bashtop with a CPU with many cores

Expected behavior
Load average view doesn't clip

Screenshots
image

Info (please complete the following information):

  • Debian 9
  • en_GB.utf8
  • GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)

[BUG] no content displayed after execute bashtop

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

Expected behavior
A clear and concise description of what you expected to happen.
1587874024199

Screenshots
If applicable, add screenshots to help explain your problem.

Info (please complete the following information):

  • Linux distribution and version
    Description: Ubuntu 16.04.4 LTS
  • System locale (output of "echo $LANG")
  • Bash version
    en_US.UTF-8
    GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
    Additional context
    $HOME/.config/bashtop/error.log" (enable error-logging in "$HOME/.config/bashtop/bashtop.cfg" if missing)

error

[REQUEST] release management ?

Is your feature request related to a problem? Please describe.
currently, there is no release / no tag.

Describe the solution you'd like
it could be nice to make official release of bashtop version (at list with tags ☺️ ) in order to ease the package managers support.

Describe alternatives you've considered
I can see that there is a AUR package but it's targetting only git version.

Additional context
this software is super cool

[BUG] Does not use XDG Base Directory spec

Describe the bug
It creates an config file at $HOME/.config/bashtop/bashtop.cfg

To Reproduce
Steps to reproduce the behavior:

  1. Start bashtop

Expected behavior
Create an config file at ${XDG_CONFIG_HOME:-$HOME/.config}/bashtop/bashtop.cfg

Screenshots
(none)

Info (please complete the following information):

  • Linux distribution and version: none, just looked at the code
  • System locale (output of "echo $LANG"): none, just looked at the code
  • Bash version: none, just looked at the code

Additional context

bashtop/bashtop

Line 3412 in dac039e

if [[ -d "$HOME/.config/bashtop" && -w "$HOME/.config/bashtop" ]] || mkdir -p "$HOME/.config/bashtop"; then

There is also $XDG_CONFIG_DIRS you could use if you implement "config layering" (like get the (default) values from the system configuration first etc.)

See the XDG Base Directory Specification, and the XDG Base Directory article on the archlinux wiki.

[BUG] Closes after a few seconds [Proxmox]

Describe the bug
Closes after a few seconds

To Reproduce
Rnn bashtop

Info (please complete the following information):

  • Linux distribution and version => Linux version 4.15.18-21-pve (build@pve) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)) #1 SMP PVE 4.15.18-48 (Fri, 20 Sep 2019 11:28:30 +0200) (CT Proxmox debian 9)
  • System locale (output of "echo $LANG") => C
  • Bash version => GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)

Additional context
$HOME/.config/bashtop/error.log" (enable error-logging in "$HOME/.config/bashtop/bashtop.cfg" if missing)
New instance of bashtop version: 0.8.4 Pid: 89374
10:59:27 ERROR: On line 1976
10:59:27 ERROR: On line 1976 (MUTED!)
./bashtop: line 1317: ( 100*(3677863579281055702-3677863579281055702-3677863579280962350+3677863579280962350) ) / (3677863579281055702-3677863579281055702) : division by 0 (error token is "(3677863579281055702-3677863579281055702) ")

[REQUEST] Donations

Where can I donate to support the project?

Could you share a cryptocurrency address, a Paypal, a Patreon or whatever so we can support please? 🙂

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.