Git Product home page Git Product logo

kmon's Introduction


Linux Kernel Manager and Activity Monitor ๐Ÿง๐Ÿ’ป


The kernel is the part of the operating system that facilitates interactions between hardware and software components. On most systems, it is loaded on startup after the bootloader and handles I/O requests as well as peripherals like keyboards, monitors, network adapters, and speakers. Typically, the kernel is responsible for memory management, process management, device management, system calls, and security. Applications use the system call mechanism for requesting a service from the operating system and most of the time, this request is passed to the kernel using a library provided by the operating system to invoke the related kernel function. While the kernel performs these low-level tasks, it's resident on a separate part of memory named protected kernel space which is not accessible by applications and other parts of the system. In contrast, applications like browsers, text editors, window managers or audio/video players use a different separate area of the memory, user space. This separation prevents user data and kernel data from interfering with each other and causing instability and slowness, as well as preventing malfunctioning application programs from crashing the entire operating system.
There are different kernel designs due to the different ways of managing system calls and resources. For example, while monolithic kernels run all the operating system instructions in the same address space for speed, microkernels use different spaces for user and kernel services for modularity. Apart from those, there are hybrid kernels, nanokernels, and, exokernels. The hybrid kernel architecture is based on combining aspects of microkernel and monolithic kernels.

The Linux kernel is the open-source, monolithic and, Unix-like operating system kernel that used in the Linux distributions, various embedded systems such as routers and as well as in the all Android-based systems. Linus Torvalds conceived and created the Linux kernel in 1991 and it's still being developed by thousands of developers today. It's a prominent example of free and open source software and it's used in other free software projects, notably the GNU operating system. Although the Linux-based operating systems dominate the most of computing, it still carries some of the design flaws which were quite a bit of debate in the early days of Linux. For example, it has the largest footprint and the most complexity over the other types of kernels. But it's a design feature that monolithic kernels inherent to have. These kind of design issues led developers to add new features and mechanisms to the Linux kernel which other kernels don't have.

Unlike the standard monolithic kernels, the Linux kernel is also modular, accepting loadable kernel modules (LKM) that typically used to add support for new hardware (as device drivers) and/or filesystems, or for adding system calls. Since LKMs could be loaded and unloaded to the system at runtime, they have the advantage of extending the kernel without rebooting and re-compiling. Thus, the kernel functionalities provided by modules would not reside in memory without being used and the related module can be unloaded in order to free memory and other resources.
Loadable kernel modules are located in /lib/modules with the .ko (kernel object) extension in Linux. While the lsmod command could be used for listing the loaded kernel modules, modprobe or insmod/rmmod is used for loading or unloading a kernel module. insmod/rmmod are used for modules independent of modprobe and without requiring an installation to /lib/modules/$(uname -r).

Here's a simple example of a Linux kernel module that prints a message when it's loaded and unloaded. The build and installation steps of the module using a Makefile are shown below.

make                         # build
sudo make install            # install
sudo modprobe lkm_example    # load
sudo modprobe -r lkm_example # unload

The dmesg command is used below to retrieve the message buffer of the kernel.

[16994.295552] [+] Example kernel module loaded.
[16996.325674] [-] Example kernel module unloaded.

kmon provides a text-based user interface for managing the Linux kernel modules and monitoring the kernel activities. By managing, it means loading, unloading, blacklisting and showing the information of a module. These updates in the kernel modules, logs about the hardware and other kernel messages can be tracked with the real-time activity monitor in kmon. Since the usage of different tools like dmesg and kmod are required for these tasks in Linux, kmon aims to gather them in a single terminal window and facilitate the usage as much as possible while keeping the functionality.

kmon is written in Rust and uses Ratatui & termion libraries for its text-based user interface.

Table of Contents

Installation

Packaging status

Cargo

kmon can be installed from crates.io using Cargo if Rust is installed.

cargo install kmon

The minimum supported Rust version (MSRV) is 1.70.0.

Arch Linux

kmon can be installed from the Arch Linux official repository.

pacman -S kmon

There is also a development package on the AUR. Use your favorite AUR helper to install. For example,

paru -S kmon-git

Nixpkgs

kmon can be installed using Nix package manager from nixpkgs-unstable channel.

nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update nixpkgs
nix-env -iA nixpkgs.kmon

On NixOS:

nix-channel --add https://nixos.org/channels/nixos-unstable
nix-channel --update nixos
nix-env -iA nixos.kmon

Alpine Linux

kmon is available for Alpine Edge. It can be installed via apk after enabling the community repository.

apk add kmon

Docker

Docker Hub Build Status

docker run -it --cap-add syslog orhunp/kmon:tagname

Build

docker build -t kmon .

Run

docker run -it --cap-add syslog kmon

Manual

  1. Download the latest binary from releases section and pick between glibc or musl-libc binary.
  2. To download the package compiled with glibc run:
wget https://github.com/orhun/kmon/releases/download/v[VERSION]/kmon-[VERSION]-x86_64-unknown-linux-gnu.tar.gz
  1. To download the package compiled with musl-libc run:
wget https://github.com/orhun/kmon/releases/download/v[VERSION]/kmon-[VERSION]-x86_64-unknown-linux-musl.tar.gz
  1. Extract the files.
tar -xvzf kmon-*.tar.gz
  1. Enter in the new folder.
cd kmon-[VERSION]
  1. Run the binary.
./kmon
  1. Move binary to /usr/local/bin/ for running it from the terminal using kmon command.

  2. Man page and shell completions are generated at build time in target directory.

Note

libxcb should be installed for using the copy/paste commands of X11.

e.g: Install libxcb1-dev package for Debian/Ubuntu* and libxcb-devel package for Fedora/openSUSE/Void Linux.

Usage

kmon [OPTIONS] [COMMAND]

Options

-a, --accent-color <COLOR>  Set the accent color using hex or color name [default: white]
-c, --color <COLOR>         Set the main color using hex or color name [default: darkgray]
-t, --tickrate <MS>         Set the refresh rate of the terminal [default: 250]
-r, --reverse               Reverse the kernel module list
-u, --unicode               Show Unicode symbols for the block titles
-h, --help                  Print help information
-V, --version               Print version information

Commands

sort  Sort kernel modules

Sort

kmon sort [OPTIONS]

Options:

-s, --size       Sort modules by their sizes
-n, --name       Sort modules by their names
-d, --dependent  Sort modules by their dependent modules
-h, --help       Print help information

Key Bindings

[?], F1 Help
right/left, h/l Switch between blocks
up/down, k/j, alt-k/j Scroll up/down [selected block]
pgup/pgdown Scroll up/down [kernel activities]
</> Scroll up/down [module information]
alt-h/l Scroll right/left [kernel activities]
ctrl-t/b, home/end Scroll to top/bottom [module list]
alt-e/s Expand/shrink the selected block
ctrl-x Change the block position
ctrl-l/u, alt-c Clear the kernel ring buffer
[d], alt-d Show the dependent modules
[1]..[9] Jump to the dependent module
[\], tab, backtab Show the next kernel information
[/], s, enter Search a kernel module
[+], i, insert Load a kernel module
[-], u, backspace Unload the kernel module
[x], b, delete Blacklist the kernel module
ctrl-r, alt-r Reload the kernel module
m, o Show the options menu
y/n Execute/cancel the command
c/v Copy/paste
r, F5 Refresh
q, ctrl-c/d, ESC Quit

Features

Help

Press '?' while running the terminal UI to see key bindings.

Help

Navigating & Scrolling

Arrow keys are used for navigating between blocks and scrolling.

Navigating & Scrolling

Scrolling Kernel Activities

Some kernel messages might be long enough for not fitting into the kernel activities block since they are not wrapped. In this situation, kernel activities can be scrolled horizontally with alt-h & alt-l keys. Vertical scrolling mechanism is the same as other blocks.

Scrolling Kernel Activities

Smooth Scrolling

alt-j & alt-k keys can be used to scroll kernel activity and module information blocks slowly.

Smooth Scrolling

Options Menu

m and o keys can be used as a shortcut for kernel management operations. When pressed, an options menu will be provided for managing the currently selected kernel module.

Options Menu

Block Sizes

alt-e & alt-s keys can be used for expanding/shrinking the selected block.

Block Sizes

Block Positions

ctrl-x key can be used for changing the positions of blocks.

Block Positions

Kernel Information

Use one of the \, tab, backtab keys to switch between kernel release, version and platform information.

Kernel Information

Module Information

The status of a kernel module is shown on selection.

Module Information

Displaying the dependent modules

Use one of the d, alt-d keys to show all the dependent modules of the selected module.

Displaying the dependent modules

Jumping to dependent modules

For jumping to a dependent kernel module from its parent module, number keys (1-9) can be used for specifying the index of the module on the Used By column.

Dependency Information

Searching a module

Switch to the search area with arrow keys or using one of the /, s, enter and provide a search query for the module name.

Searching a module

Loading a module

For adding a module to the Linux kernel, switch to load mode with one of the +, i, insert keys and provide the name of the module to load. Then confirm/cancel the execution of the load command with y/n.

Loading a module

The command that used for loading a module:

modprobe <module_name> || insmod <module_name>.ko

Unloading a module

Use one of the -, u, backspace keys to remove the selected module from the Linux kernel.

Unloading a module

The command that used for removing a module:

modprobe -r <module_name> || rmmod <module_name>

Blacklisting a module

Blacklisting is a mechanism to prevent the kernel module from loading. To blacklist the selected module, use one of the x, b, delete keys and confirm the execution.

Blacklisting a module

The command that used for blacklisting a module:

if ! grep -q <module_name> /etc/modprobe.d/blacklist.conf; then
  echo 'blacklist <module_name>' >> /etc/modprobe.d/blacklist.conf
  echo 'install <module_name> /bin/false' >> /etc/modprobe.d/blacklist.conf
fi

Reloading a module

Use ctrl-r or alt-r key for reloading the selected module.

Reloading a module

The command that used for reloading a module:

modprobe -r <module_name> || rmmod <module_name> && modprobe <module_name> || insmod <module_name>.ko

Clearing the ring buffer

The kernel ring buffer can be cleared with using one of the ctrl-l/u, alt-c keys.

Clearing the ring buffer

dmesg --clear

Copy & Paste

c/v keys are set for copy/paste operations.

Copy & Paste

Use ctrl-c/ctrl-v for copying and pasting while in input mode.

Sorting/reversing the kernel modules

sort subcommand can be used for sorting the kernel modules by their names, sizes or dependent modules.

kmon sort --name
kmon sort --size
kmon sort --dependent

Sorting the kernel modules

Also the -r, --reverse flag is used for reversing the kernel module list.

kmon --reverse

Reversing the kernel modules

Customizing the colors

kmon uses the colors of the terminal as default but the highlighting color could be specified with -c, --color option. Alternatively, default text color can be set via -a, --accent-color option.

Supported colors

Supported terminal colors are black, red, green, yellow, blue, magenta, cyan, gray, darkgray, lightred, lightgreen, lightyellow, lightblue, lightmagenta, lightcyan, white.

kmon --color red

Supported Colors

Using a custom color

Provide a hexadecimal value for the color to use.

kmon --color 19683a

Using a custom color

Changing the accent color

Default text color might cause readability issues on some themes that have transparency. -a, --accent-color option can be used similarly to the -c, --color option for overcoming this issue.

kmon --color 6f849c --accent-color e35760

Changing the accent color

Unicode symbols

Use -u, --unicode flag for showing Unicode symbols for the block titles.

kmon --unicode

Unicode symbols

Setting the terminal tick rate

-t, --tickrate option can be used for setting the refresh interval of the terminal UI in milliseconds.

Setting the terminal tick rate

Roadmap

kmon aims to be a standard tool for Linux kernel management while supporting most of the Linux distributions.

Accessibility

For achieving this goal, kmon should be accessible from different package managers such as Snap* and RPM.

Dependencies

It is required to have the essential tools like dmesg and kmod on the system for kmon to work as expected. Thus the next step would be using just the system resources for these functions.

Features

Management actions about the Linux kernel should be applicable in kmon for minimizing the dependence on to command line and other tools.

Testing

kmon should be tested and reported on different architectures for further development and support.

Resources

About the project

Articles

In the media

Gallery

Fedora 31 Debian 10 Manjaro 19
kmon on fedora kmon on debian kmon on manjaro
Ubuntu 18.04 openSUSE Void Linux
kmon on ubuntu kmon on opensuse kmon on voidlinux

Social Media

Funding

GitHub

Support the development of my projects by supporting me on GitHub Sponsors.

Patreon

Patreon Button

Open Collective

Open Collective backers Open Collective sponsors

Support the open source development efforts by becoming a backer or sponsor.

Open Collective Button

License

GNU General Public License (3.0)

Copyright

Copyright ยฉ 2020-2024, Orhun Parmaksฤฑz

kmon's People

Contributors

bors[bot] avatar dependabot[bot] avatar eld4niz avatar euclio avatar kianmeng avatar mdevlamynck avatar misuzu avatar muttleyxd avatar nawok avatar orhun avatar stephanlachnit avatar strykar avatar tavianator avatar tim77 avatar tpiekarski avatar victorhck avatar woshilapin avatar

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

kmon's Issues

FYI: Ubuntu gives "note: /usr/bin/ld: cannot find -lxcb-render" => needs: libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev

On Ubuntu 20.04, I did

sudo apt-get install cargo libxcb1-dev
cargo install kmon

but that resulted in:

  = note: /usr/bin/ld: cannot find -lxcb-render
          /usr/bin/ld: cannot find -lxcb-shape
          /usr/bin/ld: cannot find -lxcb-xfixes
          collect2: error: ld returned 1 exit status

After

sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev

things went OK: a fresh binary /home/sander/.cargo/bin/kmon

So those libraries are needed too, and are not installed by installing libxcb1-dev ? If so, shall I sent a PR for the README.md?

Add an options menu

Is your feature request related to a problem? Please describe.
It would be good to have an options menu like https://github.com/orhun/gpg-tui#options-menu

Describe the solution you'd like
Create a popup at the center of kernel modules list and show available options to manage the selected kernel module.

Additional context

Function for reloading modules with keybinding

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

It is related to the problem when developing modules, building custom kernels or
trying to make some proprietary module work. In such cases it is often necessary
to quickly reload a module (in a followup issue it could be also reloaded with
different arguments passed to the module).

Describe the solution you'd like

The solution could be to provide a function for reloading (unloading and loading) a module
and to offer the keybinding r (colliding with refresh, so maybe a R or moving refresh to C^r like in browsers).

Describe alternatives you've considered

None have been considered, because the unloading function currently present is very similar
and works very well.

Additional context

There're a Load and Unload command defined in ModuleCommand and those would be used together to implement this reload feature. Either as a new function in ModuleCommand or when registering with the key input event handling both already present function would be called.

I'd like to provide a PR.

Error: kmon.man not found

When reading the Installation instructions, I clicked on "kmon.man" because I was interested in the man page for kmon. Unfortunately, this links to an non-existing Github page.

Add string "kmod" to man 8 so it appears via apropos/man -k

Is your feature request related to a problem? Please describe.
I often forget the name of kmon (not to say it isn't an intuitive name) and try to find it in a terminal via apropos/man -k using the string kmod which does not list kmon.

Describe the solution you'd like
Add the string kmod to the man page under Name/Description like for managing the Linux kernel modules (kmod)

Describe alternatives you've considered
Patching the man page for my Arch install, I'd be happy to submit a PR if you fancy the idea

Change default key Bindings

Hello. Can not find anywhere whether it is possible to change default keybindings, e.g., for alt-e/s | Expand/shrink the selected block
Since i have alt key as a default modifier key in my window manager (as many people) i can not use it in kmon.

Introduce new sorting argument for most-used module

Is your feature request related to a problem? Please describe.
Not a problem, but rather an idea. Its about to quickly identify within kmon the most dependent modules which uses most other modules.

Describe the solution you'd like
Passing a new command line argument for sorting. Something like:
kmon sort -d | --dependents or kmon sort -u | --used
This argument would sort by the column used by at /proc/modules (3rd column) and could also be reversed with -r.

What do you think? I'd like to provide a PR as well.

Describe alternatives you've considered
None. Such sorting is already present for module name and size.

Additional context
None.

Update dependencies

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

There are a lot of open PRs for dependencies.

Describe the solution you'd like

Simply update dependencies and make sure everything is working.

Describe alternatives you've considered

None.

Additional context

Look into the breaking changes of ratatui.

Add support for compressed modules

Currently the module panel shows 'module information not available' when the module is compressed. I'm guessing this is caused by modinfo not displaying the info when the module is compressed. Eg

p2@amanita ~]$ modinfo snd_seq_dummy
modinfo: ERROR: Module snd_seq_dummy not found.

However when I use the full patch I get:

[p2@amanita ~]$ modinfo /lib/modules/6.8.4-arch1-1/kernel/sound/core/seq/snd-seq-dummy.ko.zst
filename:       /lib/modules/6.8.4-arch1-1/kernel/sound/core/seq/snd-seq-dummy.ko.zst
alias:          snd-seq-client-14
license:        GPL
description:    ALSA sequencer MIDI-through client
author:         Takashi Iwai <[email protected]>
srcversion:     ECCC9A4693F6A7AF4ECFFC0
depends:        snd-seq
retpoline:      Y
intree:         Y
name:           snd_seq_dummy
vermagic:       6.8.4-arch1-1 SMP preempt mod_unload 
sig_id:         PKCS#7
signer:         Build time autogenerated kernel key
sig_key:        50:E1:E3:89:21:E4:AD:11:14:FE:B7:B6:0B:46:0E:FF:76:A2:EE:8D
sig_hashalgo:   sha512
signature:      30:64:02:30:30:20:3C:8B:A8:BA:C2:97:26:A1:A6:08:62:F5:50:78:
                20:76:5F:73:53:50:34:E6:CD:D1:42:23:34:86:78:34:C1:80:4B:CD:
                E8:F8:75:87:30:7F:D4:7B:97:FD:16:B9:02:30:45:4C:AE:39:93:02:
                58:BC:35:CE:AA:17:2F:E5:11:BD:12:D9:32:E1:EE:33:D8:4C:47:68:
                97:0D:7C:52:64:94:72:F9:D9:B0:FA:0C:2F:B5:B1:BA:8D:B9:90:CC:
                D5:38
parm:           ports:number of ports to be created (int)
parm:           duplex:create DUPLEX ports (bool)

Can't upgrade to 1.4.0

Describe the bug
I'm trying to compile 1.4.0 version with cargo but it finished with error.

  = note: /usr/bin/ld: cannot find -lxcb-shape
          /usr/bin/ld: cannot find -lxcb-xfixes
          collect2: error: ld returned 1 exit status

To Reproduce
Steps to reproduce the behavior:

  1. Compile with sudo cargo install kmon --force command.

Expected behavior
Compile and install new 1.4.0 version

Screenshots/Logs
Logs from the compile process.

    Updating crates.io index
  Downloaded kmon v1.4.0
  Downloaded 1 crate (50.7 KB) in 6.47s
  Installing kmon v1.4.0
  Downloaded bytesize v1.0.1
  Downloaded unicode-width v0.1.8
  Downloaded enum-iterator v0.6.0
  Downloaded clap v2.33.2
  Downloaded clipboard v0.5.0
  Downloaded colorsys v0.5.4
  Downloaded termion v1.5.5
  Downloaded tui v0.8.0
  Downloaded enum-unitary v0.4.2
  Downloaded ansi_term v0.11.0
  Downloaded vec_map v0.8.2
  Downloaded textwrap v0.11.0
  Downloaded enum-iterator-derive v0.6.0
  Downloaded bitflags v1.2.1
  Downloaded atty v0.2.14
  Downloaded x11-clipboard v0.3.3
  Downloaded strsim v0.8.0
  Downloaded either v1.5.3
  Downloaded log v0.4.11
  Downloaded num-traits v0.2.12
  Downloaded quote v1.0.7
  Downloaded proc-macro2 v1.0.19
  Downloaded numtoa v0.1.0
  Downloaded cassowary v0.3.0
  Downloaded unicode-segmentation v1.6.0
  Downloaded libc v0.2.74
  Downloaded itertools v0.8.2
  Downloaded syn v1.0.38
  Downloaded cfg-if v0.1.10
  Downloaded xcb v0.8.2
  Downloaded autocfg v1.0.0
  Downloaded unicode-xid v0.2.1
   Compiling libc v0.2.74
   Compiling proc-macro2 v1.0.19
   Compiling log v0.4.11
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.38
   Compiling cfg-if v0.1.10
   Compiling bitflags v1.2.1
   Compiling autocfg v1.0.0
   Compiling unicode-width v0.1.8
   Compiling either v1.5.3
   Compiling numtoa v0.1.0
   Compiling strsim v0.8.0
   Compiling vec_map v0.8.2
   Compiling unicode-segmentation v1.6.0
   Compiling cassowary v0.3.0
   Compiling ansi_term v0.11.0
   Compiling bytesize v1.0.1
   Compiling colorsys v0.5.4
   Compiling textwrap v0.11.0
   Compiling itertools v0.8.2
   Compiling num-traits v0.2.12
   Compiling quote v1.0.7
   Compiling atty v0.2.14
   Compiling termion v1.5.5
   Compiling xcb v0.8.2
   Compiling clap v2.33.2
   Compiling tui v0.8.0
   Compiling x11-clipboard v0.3.3
   Compiling clipboard v0.5.0
   Compiling enum-iterator-derive v0.6.0
   Compiling enum-iterator v0.6.0
   Compiling enum-unitary v0.4.2
   Compiling kmon v1.4.0
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.kmon.acj66v5t-cgu.0.rcgu.o" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.kmon.acj66v5t-cgu.1.rcgu.o" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.kmon.acj66v5t-cgu.10.rcgu.o" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.kmon.acj66v5t-cgu.11.rcgu.o" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.kmon.acj66v5t-cgu.12.rcgu.o" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.kmon.acj66v5t-cgu.13.rcgu.o" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.kmon.acj66v5t-cgu.14.rcgu.o" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.kmon.acj66v5t-cgu.15.rcgu.o" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.kmon.acj66v5t-cgu.2.rcgu.o" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.kmon.acj66v5t-cgu.3.rcgu.o" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.kmon.acj66v5t-cgu.4.rcgu.o" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.kmon.acj66v5t-cgu.5.rcgu.o" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.kmon.acj66v5t-cgu.6.rcgu.o" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.kmon.acj66v5t-cgu.7.rcgu.o" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.kmon.acj66v5t-cgu.8.rcgu.o" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.kmon.acj66v5t-cgu.9.rcgu.o" "-o" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14" "/tmp/cargo-installBuooAj/release/deps/kmon-c05e4a56f26dab14.4ppiwg2svz00f8hk.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/tmp/cargo-installBuooAj/release/deps" "-L" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/cargo-installBuooAj/release/deps/libcolorsys-3e518bb0ad5a69ad.rlib" "/tmp/cargo-installBuooAj/release/deps/libclap-07f08cc6fcdf185e.rlib" "/tmp/cargo-installBuooAj/release/deps/libvec_map-1a06bcb0f716d2c9.rlib" "/tmp/cargo-installBuooAj/release/deps/libtextwrap-e4de17c323fc34f8.rlib" "/tmp/cargo-installBuooAj/release/deps/libstrsim-62fcbb9566b11f33.rlib" "/tmp/cargo-installBuooAj/release/deps/libatty-2d812482c98a8b03.rlib" "/tmp/cargo-installBuooAj/release/deps/libansi_term-399d9c79af21b78c.rlib" "/tmp/cargo-installBuooAj/release/deps/libbytesize-420957e69843d471.rlib" "/tmp/cargo-installBuooAj/release/deps/libtui-b097d0d9160a42e1.rlib" "/tmp/cargo-installBuooAj/release/deps/libitertools-23a5754383cae4e6.rlib" "/tmp/cargo-installBuooAj/release/deps/libeither-8f5a6e5c8171d45e.rlib" "/tmp/cargo-installBuooAj/release/deps/libbitflags-04d4a626dc324750.rlib" "/tmp/cargo-installBuooAj/release/deps/libcassowary-f0b9578c878bca06.rlib" "/tmp/cargo-installBuooAj/release/deps/libunicode_width-e9f7e28636b31438.rlib" "/tmp/cargo-installBuooAj/release/deps/libunicode_segmentation-0fb757b03cec94d6.rlib" "/tmp/cargo-installBuooAj/release/deps/libtermion-6c40df01fde41458.rlib" "/tmp/cargo-installBuooAj/release/deps/libnumtoa-bf45b4eb54bf35bb.rlib" "/tmp/cargo-installBuooAj/release/deps/libenum_unitary-b2e390d4839eff0a.rlib" "/tmp/cargo-installBuooAj/release/deps/libnum_traits-ad895ed98309e3d7.rlib" "/tmp/cargo-installBuooAj/release/deps/libenum_iterator-74eeca65958d47a7.rlib" "/tmp/cargo-installBuooAj/release/deps/libclipboard-08b3e32b0c1b6e7d.rlib" "/tmp/cargo-installBuooAj/release/deps/libx11_clipboard-b205c83a6d605d8e.rlib" "/tmp/cargo-installBuooAj/release/deps/libxcb-80c689becef29706.rlib" "/tmp/cargo-installBuooAj/release/deps/liblog-a6ff18f6efc50c20.rlib" "/tmp/cargo-installBuooAj/release/deps/libcfg_if-4538d89b6d34b017.rlib" "/tmp/cargo-installBuooAj/release/deps/liblibc-35db208ec6c99d77.rlib" "-Wl,--start-group" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-b1b61f01951b016b.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-1a219005f9510085.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-de703a5f53bf135e.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-f8b5f83d4ba2b90f.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-c6dc8f69734bcae2.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-4546f4207f7495c9.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-2ac782148854dc56.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-cf897c39850c16b7.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-9d727da20068fc09.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-bd6ee87558a376f2.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-182e50caadead100.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-88083985464b6af5.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-83ed8731003cd087.rlib" "-Wl,--end-group" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-d61dbae1fa88f6f5.rlib" "-Wl,-Bdynamic" "-lxcb" "-lxcb" "-lxcb" "-lxcb" "-lxcb-render" "-lxcb-shape" "-lxcb-xfixes" "-lutil" "-ldl" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
  = note: /usr/bin/ld: cannot find -lxcb-shape
          /usr/bin/ld: cannot find -lxcb-xfixes
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error

error: failed to compile `kmon v1.4.0`, intermediate artifacts can be found at `/tmp/cargo-installBuooAj`

Caused by:
  could not compile `kmon`.

To learn more, run the command again with --verbose.

System (please complete the following information):

  • OS Information: Ubuntu 20.04, kernel 5.4.0-42-lowlatency
  • Rust Version: 1.43
  • Project Version: 1.4.0

Additional context
There's no any other context

RUSTSEC-2022-0056: clipboard is Unmaintained

clipboard is Unmaintained

Details
Status unmaintained
Package clipboard
Version 0.5.0
URL aweinstock314/rust-clipboard#91
Date 2022-06-25

Last release was almost 4 years ago and the repository with outstanding issues and pull requests seems to be abandoned by the maintainer.

In addition the sole maintainer account may be abandoned that may represent account takeover risk.

Current outstanding issues include vulnerable dependencies that all together may mean that security issues may not be addressed now or in the future.

Possible Alternative(s)

The below list has not been vetted in any way and may or may not contain alternatives;

See advisory page for additional details.

RUSTSEC-2021-0139: ansi_term is Unmaintained

ansi_term is Unmaintained

Details
Status unmaintained
Package ansi_term
Version 0.12.1
URL ogham/rust-ansi-term#72
Date 2021-08-18

The maintainer has adviced this crate is deprecated and will not
receive any maintenance.

The crate does not seem to have much dependencies and may or may not be ok to use as-is.

Last release seems to have been three years ago.

Possible Alternative(s)

The below list has not been vetted in any way and may or may not contain alternatives;

See advisory page for additional details.

some Ideas

Your program is very interresting.

  1. You also could enable/disable IPv6 feature.
  2. On each module you have options. The idea is to be able to set all drivers options
modinfo <modules>
options <modules> options1=X options2=Y ...

If it s possibe, to have the default value, and the best value

  1. to unload drivers over the grub kernel ex: ipv6.disable=1
    you could use this command :
    grubby --remove-args="argX argY" --args="argA argB" --update-kernel

  2. or to propose to add some options to the grub if you have a specific hardware.ex: gpu nvidia, cpu intel,wifi broadcom,...

  3. Backup/restore configuration by command line.

regards,

Could not compile - "ld returned 1 exit status"

Describe the bug
Tried to compile with cargo.
got error compiling

/usr/bin/ld: cannot find -lxcb
/usr/bin/ld: cannot find -lxcb
/usr/bin/ld: cannot find -lxcb
/usr/bin/ld: cannot find -lxcb
/usr/bin/ld: cannot find -lxcb-render
/usr/bin/ld: cannot find -lxcb-shape
/usr/bin/ld: cannot find -lxcb-xfixes
collect2: error: ld returned 1 exit status

/usr/lib64/libxcb.so.1 --> Installed

To Reproduce
Steps to reproduce the behavior:

  1. Run with 'cargo install kmon'
  2. See error

Expected behavior
A clear compilation

System:

  • OS Information: 5.5.11-200.fc31.x86_64 Fedora 31
  • Rust Version: rustc 1.42.0

Support for low-level module handling with insmod/rmmod

Is your feature request related to a problem? Please describe.
The current way to load modules from within kmon is based upon modprobe. modprobe requires modules being inside /lib/modules/$(uname -r). This requirement having to install modules into that directory and update dependency tree with depmod is sometimes cumbersome. And to install some early development stage or experimental modules into the system should not be required.

Describe the solution you'd like
Offer a way to use insmod and rmmod for loading/unloading module independent of modprobe and without automatic dependent module handling. A possible implementation could be to try loading/unloading module with insmod/rmmod after modprobe failed.

On second thought kmon could determine what to use if there is a filename with a .ko suffix provided. insmod require the full filename and modprobe only loads a module by its module name and defined aliases.

Describe alternatives you've considered
None, because loading a module with a path and a filename is not possible with modprobe.

Additional context
None

When we come to terms if and how this feature could be implemented, I would like to provide a PR.

Use consistent code comments

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

Java-like code commenting is used throughout the codebase but there are still places where this doesn't apply.

Describe the solution you'd like

Use rustdoc friendly code comments.

Describe alternatives you've considered

None.

Additional context

None.

RUSTSEC-2022-0048: xml-rs is Unmaintained

xml-rs is Unmaintained

Details
Status unmaintained
Package xml-rs
Version 0.8.4
URL https://github.com/netvl/xml-rs/issues
Date 2022-01-26

xml-rs is a XML parser has open issues around parsing including integer
overflows / panics that may or may not be an issue with untrusted data.

Together with these open issues with Unmaintained status xml-rs
may or may not be suited to parse untrusted data.

Alternatives

See advisory page for additional details.

Relax dependency update frequency to ease load on downstream

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

This project seems to be using extremely up to date dependencies and requiring the latest versions, even when they are not expressedly required by the code written.

For people such as myself trying to package this for downstream Linux distributions, Fedora in my case, it becomes difficult to coordinate updating all dependencies frequently.

If I want to package this, every time you release an update I would need to request multiple maintainers to perform dependency updates. Whilst once or twice this is no problem and is simply part of the job of a maintainer, when all dependencies are updated every other day it becomes near impossible to keep everything in sync.

Describe the solution you'd like

Well, I'm not a Rust developer, so I'll let you decide.

However, I can think of 2 possible solutions that might work.

  • Your dependabot config seems incorrect, you're updating dependencies frequently without any specific reason. Changing this to a slower cycle, or only updating dependencies when you need a new version or there is a security fix could resolve this.

  • Or relaxing the constraints in your Cargo.toml file to allow older versions of dependencies to be built with kmon.

Describe alternatives you've considered

  • There aren't any viable alternatives that come to mind.
  • If some solution isn't implemented, it will probably not be possible for me to package this for Fedora.

Additional context

  • Nothing specific.
  • If you want to discuss this at all, please just drop a line on this issue and I'll be more than happy to get back to you.

"error: could not compile `syn`." on ARM64 Ubuntu

Describe the bug

On an ARM64 system (with 512MB RAM) running Ubuntu 18.04.4 LTS the cargo install kmon results in an error

   Compiling termion v1.5.5
   Compiling xcb v0.8.2
   Compiling clap v2.33.0
   Compiling tui v0.8.0
error: could not compile `syn`.

Caused by:
  process didn't exit successfully: `rustc --edition=2018 --crate-name syn /home/sander/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.17/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 --cfg 'feature="clone-impls"' --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="extra-traits"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="proc-macro"' --cfg 'feature="quote"' --cfg 'feature="visit"' -C metadata=e2b1f5fd1c5e3388 -C extra-filename=-e2b1f5fd1c5e3388 --out-dir /tmp/cargo-installjPvAn0/release/deps -L dependency=/tmp/cargo-installjPvAn0/release/deps --extern proc_macro2=/tmp/cargo-installjPvAn0/release/deps/libproc_macro2-941181b9f57e249a.rmeta --extern quote=/tmp/cargo-installjPvAn0/release/deps/libquote-e10e308aa35807a2.rmeta --extern unicode_xid=/tmp/cargo-installjPvAn0/release/deps/libunicode_xid-20d847053c8b7f62.rmeta --cap-lints allow --cfg syn_disable_nightly_tests` (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: failed to compile `kmon v1.0.0`, intermediate artifacts can be found at `/tmp/cargo-installjPvAn0`

Caused by:
  build failed
sander@nanopineo2:~/git/kmon$ 

Might be related to / same as rust-lang/rust#56501

To Reproduce
Steps to reproduce the behavior:
cargo install kmon

Expected behavior
A clean compile

Screenshots/Logs
image

System (please complete the following information):

  • OS Information: Ubuntu 18.04.4 LTS
  • Rust Version: rustc 1.39.0
  • Project Version: kmon 1.0.0

Additional context
Might be caused by low RAM, or rust-lang/rust#56501 ?

Fix in Readme file Manual steps to download Kmon

fix README file to download the package in manual section
In REAMDE file in Manual you can read:

1.- Download the latest binary from releases.
wget https://github.com/orhun/kmon/releases/download/v[VERSION]/kmon-[VERSION].tar.gz

for my openSUSE Tumbleweed system I had to download the file placed in:
wget https://github.com/orhun/kmon/releases/download/v[VERSION]/kmon-[VERSION]-x86_64-unknown-linux-gnu.tar.gz

Don't know if something has changed in GitHub file structure since the README file was written...

To Reproduce
Steps to reproduce the behavior:

  1. For v1.6.2 follow the README and run wget https://github.com/orhun/kmon/releases/download/v1.6.2/kmon-1.6.2.tar.gz
  2. ERROR 404: Not Found.

Expected behavior
update the path to download file

System (please complete the following information):

  • openSUSE Tumbleweed x86_64

Add new menu layouts

Is your feature request related to a problem? Please describe.
It would be nice to have different menu layouts instead of having only one which is fixed. We already have the functionality for changing the block sizes and moving them around. This new menu(s) could be possibly change the overall layout for different use cases such as:

  • Kernel monitoring (dmesg) mode where the "Kernel Activities" block is maximized.
  • Inspection mode where only the module info is shown.

And a couple of other scenarios...

Describe the solution you'd like
Define a list of menu layouts and add a key binding for changing the current layout.

Describe alternatives you've considered
There could be a command-line argument for launching kmon with the given menu type. e.g. kmon --menu activities

Additional context
bpytop has something similar where you press m and the layout changes.

Rust Version: 1.44.1 | build error >> error[E0277]: the trait bound `app::Block: enum_iterator::IntoEnumIterator` is not satisfied

Describe the bug
build halt with two error in compile

.error[E0277]: the trait bound app::Block: enum_iterator::IntoEnumIteratoris not satisfied --> /home/art/.asdf/installs/rust/1.44.1/registry/src/github.com-1ecc6299db9ec823/kmon-1.2.0/src/app.rs:57:1 | 57 | / enum_unitary! { 58 | | #[derive(Copy, Debug, PartialEq)] 59 | | pub enum Block { 60 | | UserInput, ... | 64 | | } 65 | | } | |_^ the traitenum_iterator::IntoEnumIteratoris not implemented forapp::Block| ::: /home/art/.asdf/installs/rust/1.44.1/registry/src/github.com-1ecc6299db9ec823/enum-unitary-0.4.2/src/lib.rs:25:45 | 25 | + Bounded + ToPrimitive + FromPrimitive + IntoEnumIterator | ---------------- required by this bound inenum_unitary::EnumUnitary| help: trait impl with same name found --> /home/art/.asdf/installs/rust/1.44.1/registry/src/github.com-1ecc6299db9ec823/kmon-1.2.0/src/app.rs:57:1 | 57 | / enum_unitary! { 58 | | #[derive(Copy, Debug, PartialEq)] 59 | | pub enum Block { 60 | | UserInput, ... | 64 | | } 65 | | } | |_^ = note: perhaps two different versions of crateenum_iterator` are being used?
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound app::InputMode: enum_iterator::IntoEnumIterator is not satisfied
--> /home/art/.asdf/installs/rust/1.44.1/registry/src/github.com-1ecc6299db9ec823/kmon-1.2.0/src/app.rs:68:1
|
68 | / enum_unitary! {
69 | | #[derive(Copy, Debug, PartialEq)]
70 | | pub enum InputMode {
71 | | None,
... |
74 | | }
75 | | }
| |^ the trait enum_iterator::IntoEnumIterator is not implemented for app::InputMode
|
::: /home/art/.asdf/installs/rust/1.44.1/registry/src/github.com-1ecc6299db9ec823/enum-unitary-0.4.2/src/lib.rs:25:45
|
25 | + Bounded + ToPrimitive + FromPrimitive + IntoEnumIterator
| ---------------- required by this bound in enum_unitary::EnumUnitary
|
help: trait impl with same name found
--> /home/art/.asdf/installs/rust/1.44.1/registry/src/github.com-1ecc6299db9ec823/kmon-1.2.0/src/app.rs:68:1
|
68 | / enum_unitary! {
69 | | #[derive(Copy, Debug, PartialEq)]
70 | | pub enum InputMode {
71 | | None,
... |
74 | | }
75 | | }
| |
^
= note: perhaps two different versions of crate enum_iterator are being used?
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors

For more information about this error, try rustc --explain E0277.
error: failed to compile kmon v1.2.0, intermediate artifacts can be found at /tmp/cargo-installAiFsRB

Caused by:
could not compile kmon.

Caused by:
process didn't exit successfully: rustc --crate-name kmon --edition=2018 /home/art/.asdf/installs/rust/1.44.1/registry/src/github.com-1ecc6299db9ec823/kmon-1.2.0/src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C metadata=e545f8d8bd33e82c -C extra-filename=-e545f8d8bd33e82c --out-dir /tmp/cargo-installAiFsRB/release/deps -L dependency=/tmp/cargo-installAiFsRB/release/deps --extern bytesize=/tmp/cargo-installAiFsRB/release/deps/libbytesize-dfd1367e617f44fb.rlib --extern clap=/tmp/cargo-installAiFsRB/release/deps/libclap-b41fe8ef718cacb2.rlib --extern clipboard=/tmp/cargo-installAiFsRB/release/deps/libclipboard-33c23f869a4787d3.rlib --extern colorsys=/tmp/cargo-installAiFsRB/release/deps/libcolorsys-79f20d204a5d02d2.rlib --extern enum_iterator=/tmp/cargo-installAiFsRB/release/deps/libenum_iterator-eec005336cf21fd6.rlib --extern enum_unitary=/tmp/cargo-installAiFsRB/release/deps/libenum_unitary-08f4fb19923cffaf.rlib --extern termion=/tmp/cargo-installAiFsRB/release/deps/libtermion-2e03e248c2193d20.rlib --extern tui=/tmp/cargo-installAiFsRB/release/deps/libtui-b600972d1b9b84b2.rlib --extern unicode_width=/tmp/cargo-installAiFsRB/release/deps/libunicode_width-f22b9e6fd9fe1f27.rlib --cap-lints allow (exit code: 1)`

To Reproduce
Steps to reproduce the behavior:

  1. Run with '...' parameters
  2. Use the '....' feature
  3. Select the '....'
  4. See error

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

Screenshots/Logs
If applicable, add screenshots or logs to help explain your problem.

System (please complete the following information):

  • OS Information: Kernel: 5.4.0-37-generic x86_64 bits: 64 Desktop: Cinnamon 4.4.8
    Distro: Linux Mint 19.3 Tricia
  • Rust Version: 1.44.1
  • Project Version:last

Additional context
Add any other context about the problem here.

RUSTSEC-2021-0019: Multiple soundness issues

Multiple soundness issues

Details
Package xcb
Version 0.8.2
URL rustsec/advisory-db#653
Date 2021-02-04

Calls std::str::from_utf8_unchecked() without any checks

The function xcb::xproto::GetAtomNameReply::name() calls
std::str::from_utf8_unchecked() on the raw bytes that were received from the
X11 server without any validity checks. The X11 server only prevents interior
null bytes, but otherwise allows any X11 client to create an atom for arbitrary
bytes.

This issue is tracked here: https://github.com/rtbo/rust-xcb/issues/96

xcb::xproto::GetPropertyReply::value() allows arbitrary return types

The function xcb::xproto::GetPropertyReply::value() returns a slice of type
T where T is an unconstrained type parameter. The raw bytes received from
the X11 server are interpreted as the requested type.

The users of the xcb crate are advised to only call this function with the
intended types. These are u8, u16, and u32.

This issue is tracked here: https://github.com/rtbo/rust-xcb/issues/95

Out of bounds read in xcb::xproto::change_property()

xcb::xproto::change_property has (among others) the arguments format: u8 and
data: &amp;[T]. The intended use is one of the following cases:

  • format = 8 and T = u8
  • format = 16 and T = u16
  • format = 32 and T = u32
    However, this constraint is not enforced. For example, it is possible to call
    the function with format = 32 and T = u8. In this case, a read beyond the
    end of the data slice is performed and the bytes are sent to the X11 server.

The users of the xcb crate are advised to only call this function with one of
the intended argument combinations.

This issue is tracked here: https://github.com/rtbo/rust-xcb/issues/94

'Safe' wrapper around std::mem::transmute()

The function xcb::base::cast_event() takes a reference to a
xcb::base::GenericEvent and returns a reference to an arbitrary type, as
requested by the caller (or found via type interference). The function is
implemented as a direct call to std::mem::transmute(). Since the return type
is not constrained, this allows transmution to an incorrect type or a type that
is larger than the X11 event that was passed in.

X11 events are mostly always 32 bytes large and this function works as intended.

Users are advised to only cast to the event structs provided by the xcb crate
(and hope for the best).

This issue is tracked here: https://github.com/rtbo/rust-xcb/issues/78

See advisory page for additional details.

Colorscheme broken in Solarized Dark

Describe the bug

Inactive lines are ineligible in Solarized Dark colorscheme

To Reproduce
Steps to reproduce the behavior:

  1. Run Gnome Terminal
  2. Set colorscheme to "Solarized Dark"
  3. Start kmon
  4. See error

Expected behavior

The colorscheme should use color codes that work with all color schemes/let the color scheme decide what color to use.

Screenshots/Logs

solarized

System (please complete the following information):

  • OS Information: Arch GNU/Linux x86_64 5.7.10-arch1-1
  • Rust Version: unsure, I am using the Arch package
  • Project Version: 1.3.4

Add a panic hook to reset terminal upon panic

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

When an unexpected error happens, the terminal is messed up.

Describe the solution you'd like

Add a custom panic hook. See: ratatui-org/templates#13

The code changes on this PR will add a panic hook, so if a problem happens and the program panics, before the program closes it will run the code inside the panic hook that will leave alternate screen and disable raw mode. This way, you won't have your terminal messed up if an unexpected error happens.

Describe alternatives you've considered

None.

Additional context

The implementation might be the same as the linked pull request above.

Display dependent modules

Is your feature request related to a problem? Please describe.
At the moment not all dependent modules are displayed.

Describe the solution you'd like
When selecting a module in the kernel modules table all dependent modules could be displayed in module information widget in a list, sorted by name.
The current display of dependent modules in the kernel modules table could be suffixed with ....

Describe alternatives you've considered
None, but open for alternatives ๐Ÿ˜„

Additional context
None

I'd like to provide a PR.

Remote monitoring support over SSH

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

As someone who want to monitor remote hosts on my non-unix host, I'd like to see an SSH feature to allow remote monitoring on kmon. Since I don't know much about the internals of kmon whether is tightly coupled or not with the kernel itself in current code base, I'd like to ask reasonable and whether it makes sense.

Describe the solution you'd like

Introduce a new remote sub command with optional -i identity_file.

$ kmon remote [user@]host:[port] [-i identity_file]

Describe alternatives you've considered
-

Additional context
-

Switch to `ratatui`

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

ratatui is the actively maintained fork of tui-rs and it would be nice to switch to it.

Describe the solution you'd like

Update Cargo.{toml,lock} according to the instructions.

Describe alternatives you've considered

None.

Additional context

ratatui had a new release recently and there is a bug fix release on the way. It would be nice to wait until ratatui-org/ratatui#110 is merged.

dmesg not showing output in the desgnated pane

Describe the bug
When invoked as normal user dmesg not showing the output in the designated pane.

To Reproduce
Steps to reproduce the behavior:
Run as a normal user.

Expected behavior
dmesg should show the output in the designated pane.

Screenshots/Logs
Attached a screenshot for your perusal.
2020-04-06-105832_2390x768_scrot

System (please complete the following information):

  • OS Information: Gentoo, Slackware-current
  • Rust Version: [e.g. 1.40.0]
  • Project Version: kmon-1.0.0
    Additional context
    Please note, only in Arch, it is showing properly. Now, I have cross check the binaries, used by this program ,i.e dmesg , kmod permissions and locations ... look sane to me...still..

aborts when no modules present

in this case under lxc on a chromebook (and probably on generic linux in a few other cases eg with no runtime modules) there is no /proc/modules, so this panic's. In this case could it just return and empty string so it would not panic, and then show an empty set of modules?

kmon/src/kernel/lkm.rs

Lines 117 to 118 in 3ed516f

let modules_content = util::exec_cmd("sh", &["-c", &module_read_cmd])
.expect("failed to read /proc/modules");

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.