Git Product home page Git Product logo

systeroid's Introduction

systeroid โ€” A more powerful alternative to sysctl(8).

sysctl(8) is a utility on Unix-like operating systems that is used to read and modify the attributes of the kernel such as its version number, maximum limits, and security settings*. systeroid is "sysctl on steroids". It can do everything that sysctl does and even more. It provides a safer, more performant, and user-friendly CLI/TUI for managing the kernel parameters at runtime.





systeroid is implemented using procfs which is the virtual file system that is typically mapped to a mount point named /proc at boot time. This means checking the value of some kernel parameter requires opening a file in this virtual filesystem, reading its contents, parsing them, and closing the file. In Linux, these dynamically configurable kernel options are available under /proc/sys which contains directories representing the sections of the kernel and readable/writable virtual files. For example, to enable/disable IP forwarding, 1 or 0 could be written in /proc/sys/net/ipv4/ip_forward or systeroid ip_forward=1 command can be used to change the value of the parameter.

Although systeroid does not need the parameter section to be specified explicitly, it is important to know the sections and their areas of impact. Here are the available kernel sections according to the Linux kernel documentation:

Section Path Description
abi /proc/sys/abi/ execution domains & personalities
fs /proc/sys/fs/ filesystem settings
kernel /proc/sys/kernel/ global kernel information / miscellaneous settings
net /proc/sys/net/ networking settings
sunrpc /proc/sys/sunrpc/ SUN Remote Procedure Call settings
user /proc/sys/user/ user namespace limits
vm /proc/sys/vm/ memory management tuning buffer and cache management settings
dev /proc/sys/dev/ device specific information
debug /proc/sys/debug/ -

Requirements

To install the runtime dependencies:

  • on Arch Linux: pacman -S libxcb libxkbcommon linux-docs
  • on Debian/Ubuntu: apt-get install libx11-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev linux-doc
  • on Fedora: dnf install libX11-devel kernel-doc

Installation

Packaging status

Packaging status

Cargo

systeroid is available on crates.io:

cargo install systeroid
cargo install systeroid-tui

Arch Linux

systeroid can be installed from the community repository using pacman:

pacman -S systeroid

Alpine Linux

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

apk add systeroid

Binary releases

See available releases that are automated by Continuous Deployment workflow.

Building from source

# clone the repository
git clone https://github.com/orhun/systeroid && cd systeroid/

# binaries will be located at:
# - target/release/systeroid
# - target/release/systeroid-tui
CARGO_TARGET_DIR=target cargo build --release

Also see requirements.

Docker

Images

Docker builds are automated and images are available in the following registries:

Usage

The following command can be used to interactively view the documentation of selected parameters:

docker run --rm -it "orhunp/systeroid:${TAG:-latest}" --tui

Docker containers share the host system's kernel and its settings thus access to /proc and /sys are restricted for security. That is why it is not possible (and not recommended) to tweak the kernel parameters within a container. *

Building

Custom Docker images can be built from the Dockerfile:

docker build -t systeroid .

Usage

systeroid [options] [variable[=value] ...] --load[=<file>]

Options

-a, --all           display all variables (-A,-X)
-T, --tree          display the variables in a tree-like format
-J, --json          display the variables in JSON format
    --deprecated    include deprecated variables while listing
-e, --ignore        ignore unknown variable errors
-N, --names         print only variable names
-n, --values        print only variable values
-b, --binary        print only variable values without new line
-p, --load          read values from file (-f)
-S, --system        read values from all system directories
-r, --pattern <expr>
                    use a regex for matching variable names
-q, --quiet         do not print variable after the value is set
-w, --write         only enable writing a value to variable
-E, --explain       provide a detailed explanation for variable
-D, --docs <path>   set the path of the kernel documentation
-P, --no-pager      do not pipe output into a pager
-v, --verbose       enable verbose logging
    --tui           show terminal user interface
-c, --config <path> set the path of the configuration file
-h, --help          display this help and exit (-d)
-V, --version       output version information and exit

Most of the arguments/flags are inherited from sysctl so they have the same functionality.

Examples

Listing parameters

# list all parameters
systeroid -A

# list parameters in a tree-like format
systeroid -T

# list parameters in JSON format
systeroid -J

To disable colors, set the NO_COLOR environment variable.

Filtering by section

# only list parameters in the "kernel" section
systeroid kernel

# only list parameters in the "vm" and "user" sections
systeroid vm user

Displaying values

# print the name and value of a parameter (in "name=value" format)
systeroid kernel.hostname

# print only the value of a parameter
systeroid -n kernel.hostname

# print the name and values of the multiple parameters
systeroid kernel.hostname user.max_user_namespaces

Setting values

# set the value of a parameter
systeroid kernel.domainname="example.com"

# set the values of multiple parameters and ignore errors
systeroid -e kernel.dmesg_restrict=0 vm.panic_on_oom=1 unknown_param="test"

# set the values of multiple parameters and enforce the "name=value" format
systeroid -w fs.dir-notify-enable=1 net.mptcp.enabled=1 vm.oom_kill_allocating_task

Loading values from a file

Parameter values can be set from an INI file.

sysctl.conf:

# Use kernel.sysrq = 1 to allow all keys.
# See https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html for a list
# of values and keys.
kernel.sysrq = 16

# Append the PID to the core filename
kernel.core_uses_pid = 1

; Enable hard and soft link protection
; (If a line begins with a single '-', any attempts to set the value that fail will be ignored.)
-fs.protected_hardlinks = 1
fs.protected_symlinks = 1

To load it:

systeroid --load sysctl.conf

If no file is given, values are loaded from /etc/sysctl.conf as default:

systeroid --load

Specifying "-" as file name means reading data from standard input:

systeroid --load -

Loading values from the system directories

The list of default system directories are the following:

  • /etc/sysctl.d
  • /run/sysctl.d
  • /usr/local/lib/sysctl.d
  • /usr/lib/sysctl.d
  • /lib/sysctl.d
  • /etc/sysctl.conf

Use --system flag to load the files with ".conf" extension in these directories:

systeroid --system

Searching parameters

# search parameters using regex patterns
systeroid -r 'net.ipv4.conf.(eth|wlan)0.arp'
systeroid -r '^net.ipv6'

Example output of combining search with listing:

$ systeroid --names --pattern 'kernel.*_max$' --tree

kernel
โ”œโ”€โ”€ ngroups_max
โ”œโ”€โ”€ pid_max
โ””โ”€โ”€ sched_util_clamp_max

Showing information about parameters

systeroid can dump the parameter information from the kernel documentation. This is useful if you don't know what a parameter is used for.

# show information about a parameter
systeroid --explain oom_dump_tasks

Kernel documentation should be present in one of the following paths for parsing upon first launch:

  • /usr/share/doc/linux
  • /usr/share/doc/linux-doc
  • /usr/share/doc/linux-docs
  • /usr/share/doc/kernel-doc-*/Documentation

Then the parsed data is cached in $HOME/.cache/systeroid-core and used from there as long as the documentation is not updated. The caching mechanism can be disabled via setting the NO_CACHE environment variable.

This is a design choice due to the fact that different versions of kernels might be installed on different systems so the documentation might be too new or old if systeroid was to be shipped with a fixed set of parameter descriptions bundled in. With the parsing approach, documentation is always kept up-to-date.

However, this means you need to:

  • either install the kernel documentation package (based on your distribution)
    • on Arch Linux: pacman -S linux-docs
    • on Debian/Ubuntu: apt-get install linux-doc
    • on Fedora: dnf install kernel-doc
  • or explicitly specify the path of the kernel documentation.
# specify the kernel documentation path explicitly
# (not needed if you have the kernel documentation installed as a package)
systeroid -E user.max_user_namespaces --docs /usr/share/doc/linux

To change the default pager (less(1)), you can use the PAGER environment variable. Also, you can simply use --no-pager flag to disable it.

systeroid -E kernel.ctrl-alt-del --no-pager

It is also possible to retrieve information about multiple parameters:

systeroid -E --pattern '.*ipv4.*' --no-pager

Verbose logging

--verbose flag can be used to enable verbose logging:

systeroid --verbose

Also, RUST_LOG environment variable can be set accordingly to filter based on different log levels.

RUST_LOG=trace systeroid

TUI

Usage

systeroid-tui [options]
-t, --tick-rate <ms>
                    set the tick rate of the terminal [default: 250]
-D, --docs <path>   set the path of the kernel documentation
    --save-path <path>
                    set the path for saving the changed parameters
-s, --section <section>
                    set the section to filter
-q, --query <query> set the query to search
    --bg-color <color>
                    set the background color [default: black]
    --fg-color <color>
                    set the foreground color [default: white]
-n, --no-docs       do not show the kernel documentation
    --deprecated    include deprecated variables while listing
-c, --config <path> set the path of the configuration file
-h, --help          display this help and exit
-V, --version       output version information and exit

Key Bindings

Key Action
?, f1 show help
up/down, k/j, pgup/pgdown scroll list
t/b scroll to top/bottom
left/right, h/l scroll documentation
tab, ` next/previous section
: command
/ search
enter select / set parameter value
s save parameter value
c copy to clipboard
ctrl-l, f2 show logs
r, f5 refresh
esc cancel / exit
q, ctrl-c/ctrl-d exit

Examples

Launching

Simply run systeroid-tui to launch the terminal user interface. Alternatively, you can use systeroid --tui command (which runs systeroid-tui under the hood if it is found in PATH).

Showing help

Help menu and key bindings can be shown via pressing ?:

Help

Scrolling

Use up/down keys to scroll the parameter list. Alternatively, use t/b to scroll to the top/bottom.

Scroll list

Use left/right to scroll the parameter documentation.

Scroll documentation

Toggling the kernel section

Press tab or ` to toggle the kernel section for filtering entries in the parameter list.

Order of the sections is all-abi-fs-kernel-net-sunrpc-user-vm.

Toggle section

--section argument can be used to start systeroid-tui with the specified section for filtering.

systeroid-tui --section kernel

Section option

Searching

Press / and type in your query to search for parameters.

Search

Alternatively, you can start systeroid-tui with a pre-defined search query by using --query argument.

systeroid-tui --query "fs.quota"

Query option

Setting values

Press enter to select a parameter and set its value via command prompt.

Set value

You can press r to refresh the values in the parameter list.

Saving values

Press s to set a parameter value via command prompt and save its value to a file specified via --save-path.

Save value

Default save path is /etc/sysctl.conf and the values can be loaded via systeroid --load.

$ systeroid-tui --save-path /etc/sysctl.d/custom.conf

$ systeroid --system

Running commands

Press : to open the command prompt for running a command. Available commands are:

Command Description
:help show help
:search enable search
:select select the current parameter in the list
:set <name> <value> set parameter value
:save <name> <value> save parameter value to file
:scroll [area] [direction] <amount> scroll the list or text
- areas: list, docs, section
- directions: up, down, top, bottom, right, left
:copy copy to clipboard
:logs show logs
:refresh refresh values
:quit, :q quit

Copying to clipboard

Press c to show the options menu for copying the name, value, or documentation of the selected parameter.

Copy to clipboard

* systeroid-tui should be built with clipboard feature for enabling the clipboard support.

Changing the colors

Use --bg-color and --fg-color arguments to customize the colors of the terminal user interface.

# use a color name for setting the foreground color
systeroid-tui --fg-color blue

# use hexadecimal values for setting foreground/background colors
systeroid-tui --bg-color ffff99 --fg-color 003366

# use transparent background
systeroid-tui --bg-color reset

Change colors

Viewing the parameter documentation

To view the documentation as parameters are being selected on the list, kernel documentation should be parsed as explained in the "Showing information about parameters" section. A specific path for kernel documentation can be given via --docs argument or KERNEL_DOCS environment variable if it is not found in one of the locations that are checked as default.

To disable this feature altogether, use --no-docs flag.

Setting the refresh rate

It is possible to specify a value in milliseconds via --tick-rate argument for tweaking the refresh rate of the terminal which might be necessary in some cases where better performance is desired.

systeroid-tui --tick-rate 500

Logging

To view the log messages, press ctrl-l. It will bring up a pane in the TUI for analyzing the logs:

Logs

This pane consists of two parts. Left is the target selector and on the right side the logging messages view scrolling up.

The target selector controls:

  • Capturing of log messages by the logger.
  • Selection of levels for display in the logging message view.

The two columns have the following meaning:

  • Code EWIDT: E stands for Error, W for Warn, and similarly Info, Debug and Trace.
    • Inverted characters (EWIDT) are enabled log levels in the view.
    • Normal characters show enabled capturing of a log level per target.
    • If any of EWIDT are not shown, then the respective log level is not captured.

This logger pane has the following key bindings and they are only activated while the logs are being shown:

Key Action
h toggles target selector widget hidden/visible
f toggle focus on the selected target only
up select previous target in target selector widget
down select next target in target selector widget
left reduce SHOWN (!) log messages by one level
right increase SHOWN (!) log messages by one level
- reduce CAPTURED (!) log messages by one level
+ increase CAPTURED (!) log messages by one level
pageup enter Page Mode and scroll approx. half page up in log history
pagedown only in page mode: scroll 10 events down in log history
escape exit page mode and go back to scrolling mode
space toggles hiding of targets, which have logfilter set to off

For saving the logs to a file, you can use the --log-file argument:

systeroid-tui --log-file systeroid.log

RUST_LOG environment variable can be used to set the log level accordingly.

RUST_LOG=debug systeroid-tui

Configuration

systeroid can be configured with a configuration file that uses the INI format. It can be specified via --config or SYSTEROID_CONFIG environment variable. It can also be placed in one of the following global locations:

  • $HOME/.config/systeroid/systeroid.conf
  • $HOME/.systeroid/systeroid.conf
# set the config path via argument
systeroid --config config/systeroid.conf

# set the config path via env
SYSTEROID_CONFIG=config/systeroid.conf systeroid

# use a global path
mkdir -p "$HOME/.config/systeroid"
cp config/systeroid.conf "$HOME/.config/systeroid"
systeroid

See the example systeroid.conf for the configuration options.

Resources

References

Logo

systeroid logo was originally painted by Ryan Tippery as a part of the Compositions art collection and it is put together by me using the Filled Spots font. Shout out to Ryan for letting me use his painting for the logo! <3 Kudos!

Social Links

  • Follow @systeroid
  • https://orhun.dev
    • Follow @orhun
    • Follow @orhundev

In The Media

Funding

If you find systeroid and/or other projects on my GitHub profile useful, consider supporting me on GitHub Sponsors or becoming a patron!

Support me on Patreon Support me on Patreon

Contributing

See our Contribution Guide and please follow the Code of Conduct in all your interactions with the project.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache 2.0 License, shall be dual licensed as above, without any additional terms or conditions.

License

Licensed under either of Apache License Version 2.0 or The MIT License at your option.

Copyright

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

systeroid's People

Contributors

bors[bot] avatar dependabot[bot] avatar eld4niz avatar matthiasbeyer avatar nawok avatar oraoto avatar orhun avatar znley 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

systeroid's Issues

transparent background

It would be nice to be able to set transparent background or, if already possible, documented how to.

Or, maybe the background shouldn't be overridden with the default black, if that would be a way?

termion error handler should be updated

Describe the bug
Panic handler for termion does not work correctly, as we implemented new one within orhun/kmon#141

To reproduce
You can inject panic!() somewhere in the systeroid-tui(I did it within lib.rs file) and it will basically mess up your terminal emulator.

Expected behavior
As it is implemented in orhun/kmon#141, panic handler should work same and correctly to not to mess up terminal.

Screenshots / Logs
image

Software information

  • Operating system: Arch GNU/Linux x86_64 | 6.8.2-arch2-1
  • Rust version: rustc 1.77.1 (7cf61ebde 2024-03-27)
  • Project version: 0.4.4
  • Terminal Emulator: Kitty 0.33

False documentation for parameters

Describe the bug
Current regex for parsing the documentation gives false results sometimes.

To reproduce

Here is a few examples:

$ systeroid -E fs.mount-max

mount-max
=========
This denotes the maximum number of mounts that may exist
in a mount namespace.

# rest is irrelevant

2. /proc/sys/fs/binfmt_misc
===========================
# ...
$ systeroid -E net.mptcp.enabled

# completely irrelevant

seg6_enabled - BOOL
===================
Accept or drop SR-enabled IPv6 packets on this interface.
# ...

Expected behavior
Correct part of the documentation is parsed for the given parameter.

Screenshots / Logs
-

Software information

  • Operating system: Arch GNU/Linux x86_64 5.17.1-arch1-1
  • Rust version: rustc 1.62.0-nightly (8f36334ca 2022-04-06)
  • Project version: 0.1.0-rc.1

Additional context
-

Support glob patterns while preloading

Is your feature request related to a problem? Please describe.
According to sysctl.d(5), following configuration entry should be supported:

key.pattern.*.with.glob = whatever

Describe the solution you'd like
Implement the functionality with using the globwalk or regex crate.

Describe alternatives you've considered
-

Additional context
In my tests, sysctl does not work properly as well while preloading the following configuration:

# contents of sysctl.conf
net.ipv4.conf.*.rp_filter = 2
$ sysctl -p sysctl.conf
sysctl: cannot stat /proc/sys/net/ipv4/conf/*/rp_filter: No such file or directory

$ systeroid -p sysctl.conf
systeroid: cannot stat /proc/sys/net/ipv4/conf/*/rp_filter: No such file or directory
systeroid: ambiguous parameter name: net.ipv4.conf.*.rp_filter

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.

`systeroid` does not list sub/child sections as `sysctl` does

Describe the bug
For sub sections, x.y or deeper, systeroid does not show the expected output but instead a false error message, as in that the directory with the information is there.

To reproduce
Run systeroid net.ipv4, for example.

Expected behavior
Show all sub/child variables of net.ipv4 (for example) as sysctl net.ipv4 does, or as is currently shown by passing the -r flag to systeroid, systeroid -r net.ipv4.

Screenshots / Logs

$ systeroid net.ipv4
systeroid: cannot stat /proc/sys/net/ipv4: No such file or directory
$ ls -ld /proc/sys/net/ipv4
dr-xr-xr-x - root  4 Sep 22:18 /proc/sys/net/ipv4/

Software information

  • Operating system: Alpinelinux 3.17_alpha20220809
  • Rust version: 1.63.0
  • Project version: 0.2.1

Use transparent background as default for TUI

Is your feature request related to a problem? Please describe.
Right now the default background color of systeroid-tui is black which is not great when it comes to different color schemes.

Describe the solution you'd like
Make transparent background as default - i.e. do not set a color (aka reset)

The default behavior should be the same as:

$ systeroid-tui --bg-color reset

One thing to note is this is a style-wise breaking change and potentially should be noted in README.md.

Describe alternatives you've considered
None.

Additional context
See #153

Add a configuration file

Is your feature request related to a problem? Please describe.
Currently there is no way to configure the default settings of systeroid other than using the command-line arguments. These settings include kernel section colors, TUI foreground/background colors and default argument values.

Describe the solution you'd like
Support configuring the settings with a configuration file. INI format could be used.

Describe alternatives you've considered
-

Additional context
There is already a config module in the core library. This struct type could potentially be used while implementing.

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.

Compilation Failure - 'cargo install systeroid-tui'

Compiler is stable, rustc 1.72.0 (5680fa18f 2023-08-23)

Just a guess, maybe the pinned dependency version for ratatui has required an update? I see it's pinned to "=0.22.0" in systeroid-tui-0.4.3, but clearly I'm seeing 0.23.0 for some reason in the logs below.

   Compiling systeroid-tui v0.4.3
error[E0308]: mismatched types
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:485:22
     |
485  |         .style_trace(Style::default().fg(TuiColor::DarkGray))
     |          ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `Style`
     |          |
     |          arguments to this method are incorrect
     |
     = note: `Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `Style` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/style.rs:252:1
     |
252  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/style.rs:253:1
     |
253  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1338:12
     |
1338 |     pub fn style_trace(mut self, style: Style) -> Self {
     |            ^^^^^^^^^^^

error[E0308]: mismatched types
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:486:22
     |
486  |         .style_debug(Style::default().fg(TuiColor::Blue))
     |          ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `Style`
     |          |
     |          arguments to this method are incorrect
     |
     = note: `Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `Style` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/style.rs:252:1
     |
252  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/style.rs:253:1
     |
253  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1342:12
     |
1342 |     pub fn style_debug(mut self, style: Style) -> Self {
     |            ^^^^^^^^^^^

error[E0308]: mismatched types
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:487:21
     |
487  |         .style_warn(Style::default().fg(TuiColor::Yellow))
     |          ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `Style`
     |          |
     |          arguments to this method are incorrect
     |
     = note: `Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `Style` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/style.rs:252:1
     |
252  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/style.rs:253:1
     |
253  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1330:12
     |
1330 |     pub fn style_warn(mut self, style: Style) -> Self {
     |            ^^^^^^^^^^

error[E0308]: mismatched types
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:488:22
     |
488  |         .style_error(Style::default().fg(TuiColor::Red))
     |          ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `Style`
     |          |
     |          arguments to this method are incorrect
     |
     = note: `Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `Style` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/style.rs:252:1
     |
252  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/style.rs:253:1
     |
253  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1326:12
     |
1326 |     pub fn style_error(mut self, style: Style) -> Self {
     |            ^^^^^^^^^^^

error[E0308]: mismatched types
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:489:21
     |
489  |         .style_info(Style::default().fg(TuiColor::Green))
     |          ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `Style`
     |          |
     |          arguments to this method are incorrect
     |
     = note: `Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `Style` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/style.rs:252:1
     |
252  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/style.rs:253:1
     |
253  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1334:12
     |
1334 |     pub fn style_info(mut self, style: Style) -> Self {
     |            ^^^^^^^^^^

error[E0308]: mismatched types
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:490:26
     |
490  |         .highlight_style(colors.get_fg_style())
     |          --------------- ^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `Style`
     |          |
     |          arguments to this method are incorrect
     |
     = note: `Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `Style` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/style.rs:252:1
     |
252  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/style.rs:253:1
     |
253  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1310:12
     |
1310 |     pub fn highlight_style(mut self, style: Style) -> Self {
     |            ^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:491:23
     |
491  |         .border_style(colors.get_fg_style())
     |          ------------ ^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `Style`
     |          |
     |          arguments to this method are incorrect
     |
     = note: `Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `Style` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/style.rs:252:1
     |
252  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/style.rs:253:1
     |
253  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1314:12
     |
1314 |     pub fn border_style(mut self, style: Style) -> Self {
     |            ^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:492:22
     |
492  |         .border_type(BorderType::Rounded)
     |          ----------- ^^^^^^^^^^^^^^^^^^^ expected `BorderType`, found a different `BorderType`
     |          |
     |          arguments to this method are incorrect
     |
     = note: `BorderType` and `BorderType` have similar names, but are actually distinct types
note: `BorderType` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/widgets/block.rs:14:1
     |
14   | pub enum BorderType {
     | ^^^^^^^^^^^^^^^^^^^
note: `BorderType` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/widgets/block.rs:16:1
     |
16   | pub enum BorderType {
     | ^^^^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1318:12
     |
1318 |     pub fn border_type(mut self, border_type: BorderType) -> Self {
     |            ^^^^^^^^^^^

error[E0308]: mismatched types
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:493:16
     |
493  |         .style(colors.get_bg_style())
     |          ----- ^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `Style`
     |          |
     |          arguments to this method are incorrect
     |
     = note: `Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `Style` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/style.rs:252:1
     |
252  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/style.rs:253:1
     |
253  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1322:12
     |
1322 |     pub fn style(mut self, style: Style) -> Self {
     |            ^^^^^

error[E0277]: the trait bound `TuiLoggerSmartWidget<'_>: Widget` is not satisfied
   --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:501:25
    |
501 |     frame.render_widget(logger_widget, rect);
    |           ------------- ^^^^^^^^^^^^^ the trait `Widget` is not implemented for `TuiLoggerSmartWidget<'_>`
    |           |
    |           required by a bound introduced by this call
    |
    = help: the following other types implement trait `Widget`:
              Canvas<'a, F>
              LineGauge<'a>
              BarChart<'a>
              ratatui::widgets::Block<'a>
              Chart<'a>
              Clear
              Gauge<'a>
              List<'a>
            and 4 others
note: required by a bound in `Frame::<'a, B>::render_widget`
   --> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/terminal.rs:89:12
    |
87  |     pub fn render_widget<W>(&mut self, widget: W, area: Rect)
    |            ------------- required by a bound in this associated function
88  |     where
89  |         W: Widget,
    |            ^^^^^^ required by this bound in `Frame::<'a, B>::render_widget`

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `systeroid-tui` (lib) due to 10 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `systeroid-tui v0.4.3`, intermediate artifacts can be found at `/tmp/cargo-installGz8EVJ`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Vector values are not separated in TUI

Describe the bug
In TUI mode, vector of integers are not correctly separated.

To reproduce

systeroid-tui -q  net.ipv4.tcp_mem

Expected behavior

tcp_mem is a vector of 3 intergers, 182769243695365538 should be displayed as 182769 243695 365538

Screenshots / Logs

sc-20220417-114845

Software information

  • Operating system: x86_64 GNU/Linux 5.17.3-arch1-1
  • Rust version: rustc 1.61.0-nightly (6af09d250 2022-04-03)
  • Project version: master, d65f8f6

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.

Support saving changed values

Describe the solution you'd like
Support saving changed values to a specified file, i.e. 99-local.conf (possibly specified in a config file in RFE #12)

Describe alternatives you've considered
Could also dump changed values to terminal in a format suitable for copy/paste

Verbose logging for TUI

Is your feature request related to a problem? Please describe.
Printing to stdout is not possible while running TUI since the output is locked by the terminal backend (termion). This causes verbose logging to be suppressed.

Describe the solution you'd like
Add a new command-line flag named --verbose and somehow enable verbose logging while running the TUI.

Describe alternatives you've considered
-

Additional context
This will be useful when some of the parameters cannot be retrieved due to insufficient permissions and error logs are printed. Right now there is no way of telling when the parameter list is fetched without errors when the TUI is launched.

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.