System Administration

Essential System Tools: kmon – manage Linux kernel modules

This series highlights essential system tools. These are small utilities, useful for system administrators as well as regular users of Linux based systems. The series examines both graphical and text based open source utilities. For details of all tools in this series, please check the table in the summary section.

kmon is a text-based tool to help you manage the Linux kernel modules and monitor the kernel activities. With this tool, you can load, unload, and blacklist modules, as well as show a module’s information.

kmon is written in Rust and uses the tui-rs and termion libraries for its text-based user interface.

Installation

We tested kmon on the newly released Ubuntu 22.10 distro, installing the deb package from repology.org.

In Operation

Here’s an image of kmon in action. You’ll need to run the program as root (using sudo) to load/unload/blacklist modules.

kmon
Click image for full size

At the top is a search bar. We can navigate to this box with the / key (or with the arrow keys / Vim keys).

The box lets us search through the list of kernel modules (all the modules loaded by our kernel). As we type characters in the box we see modules that match. On our system we have 122 loaded kernel modules. As we type “nv” the list reduces to just 6 modules.

The search functionality makes it easy to find modules that are loaded by our system which we know we aren’t using. We can then unload these modules (with the u key).

Pressing the i key lets us load a kernel module. We can reload a module with ALT + r This kills the module and restarts it. To blacklist a module press b. Blacklisting a module is a way to stop the kernel module from loading. This can be useful if specific hardware is not needed or for diagnostic purposes. For all of these actions, kmon shows the command that is going to be executed.

At the bottom of the interface is a box headed kernel activities. This is the kernel ring buffer which is a kernel log. kmon converts dmesg’s timestamp into a human-readable date and time format.

Summary

kmon is a big time-saver if you frequently need to load/unload/blacklist kernel modules. All of the actions it performs can, of course, be executed outside of kmon.

kmon relies on a variety of tools to display information and perform actions. For example, modprobe or insmod/rmmod is used for loading or unloading a kernel module. To print the message buffer of the kernel kmon relies on dmesg (diagnostic messages).

Website: kmon.cli.rs
Support: GitHub Code Repository
Developer: Orhun Parmaksız
License: GNU General Public License v3.0

kmon is written in Rust. Learn Rust with our recommended free books and free tutorials.


All the essential tools in this series:

Essential System Tools
AlacrittyInnovative, hardware-accelerated terminal emulator
BleachBitSystem cleaning software. Quick and easy way to service your computer
bottomGraphical process/system monitor for the terminal
btop++Monitor usage and stats for CPU, memory, disks, network and processes
catfishVersatile file searching software
ClonezillaPartition and disk cloning software
CPU-XSystem profiler with both a GUI and text-based
CzkawkaFind duplicate files, big files, empty files, similar images, and much more
ddrescueData recovery tool, retrieving data from failing drives as safely as possible
dustMore intuitive version of du written in Rust
f3Detect and fix counterfeit flash storage
Fail2banBan hosts that cause multiple authentication errors
fdupesFind or delete duplicate files
FirejailRestrict the running environment of untrusted applications
GlancesCross-platform system monitoring tool written in Python
GPartedResize, copy, and move partitions without data
GreenWithEnvyNVIDIA graphics card utility
gtopSystem monitoring dashboard
gWakeOnLANTurn machines on through Wake On LAN
hyperfineCommand-line benchmarking tool
HyFetchSystem information tool written in Python
inxiCommand-line system information tool that's a time-saver for everyone
journalctlQuery and display messages from the journal
kmonManage Linux kernel modules with this text-based tool
KrusaderAdvanced, twin-panel (commander-style) file manager
NmapNetwork security tool that builds a "map" of the network
nmonSystems administrator, tuner, and benchmark tool
nnnPortable terminal file manager that's amazingly frugal
petSimple command-line snippet manager
PingnooGraphical representation for traceroute and ping output
ps_memAccurate reporting of software's memory consumption
SMCMulti-featured system monitor written in Python
TimeshiftReliable system restore tool
QDirStatQt-based directory statistics
QJournalctlGraphical User Interface for systemd’s journalctl
TLPMust-have tool for anyone running Linux on a notebook
UnisonConsole and graphical file synchronization software
VeraCryptStrong disk encryption software
VentoyCreate bootable USB drive for ISO, WIM, IMG, VHD(x), EFI files
WTFPersonal information dashboard for your terminal
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Please read our FAQ before making a comment.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments