← All guides

Check Kernel Module Status: lsmod, modinfo & dmesg

Updated:

Check Kernel Module Status: lsmod, modinfo & dmesg

Need to check kernel module status on your Linux server? Want to monitor loaded modules, verify module health, and detect module loading failures? This guide shows you how to check kernel module status using built-in commands and automated monitoring with Zuzia.app.

For comprehensive kernel module monitoring strategies, see Kernel Module Monitoring. For troubleshooting kernel issues, see Kernel Module Loading Errors.

Why Checking Kernel Module Status Matters

Kernel modules provide hardware drivers, filesystem support, and system functionality. When kernel modules fail to load or become unavailable, hardware can malfunction, filesystems can become inaccessible, and system functionality can be compromised. Checking kernel module status helps you verify modules load successfully, detect module failures, track module health, and maintain system stability.

Method 1: List Loaded Modules

List loaded modules to see what modules are currently active:

View Loaded Modules

# List all loaded modules
lsmod

# List modules with details
lsmod | head -20

# Search for specific module
lsmod | grep module-name

# List modules by size
lsmod | sort -k2 -rn | head -20

Check Module Information

# Show module information
modinfo module-name

# Show module dependencies
modinfo module-name | grep depends

# Show module description
modinfo module-name | grep description

# List all available modules
find /lib/modules/$(uname -r) -name "*.ko" | wc -l

Method 2: Verify Module Status

Verify module status to ensure modules are loaded correctly:

Check Module Loading

# Check if module is loaded
lsmod | grep -q module-name && echo "Loaded" || echo "Not loaded"

# View module usage count
lsmod | grep module-name | awk '{print $3}'

# Check module dependencies
modinfo module-name | grep depends

# Verify critical modules
lsmod | grep -E "ext4|xfs|nfs|network-module"

Monitor Module Health

# Check for missing required modules
for mod in ext4 xfs nfs; do
  lsmod | grep -q $mod && echo "$mod: OK" || echo "$mod: MISSING"
done

# Verify hardware driver modules
lsmod | grep -E "usb|pci|scsi|ata"

# Check module loading errors
dmesg | grep -i "module.*error\|module.*fail"

Method 3: Detect Module Failures

Detect module failures to identify problematic modules:

Identify Failed Modules

# Check for module loading errors
dmesg | grep -i "module.*error\|module.*fail"

# View failed module loads
journalctl -k | grep -i "module.*fail"

# Check for module dependency failures
dmesg | grep -i "module.*depend.*fail"

# View module error messages
dmesg | grep -i "error" | grep -i "module"

Monitor Module Loading

# View kernel messages for modules
dmesg | grep -i "module\|insmod\|modprobe"

# View recent module loading
dmesg | grep -i "module" | tail -20

# Check module loading in system log
journalctl -k | grep -i "module"

Method 4: Automated Module Status Monitoring with Zuzia.app

Manual checks work while you are looking. To keep running them without you, Zuzia uses its agent and scheduled tasks.

How it works in Zuzia

  • Install the Zuzia agent on the server with one command. CPU, RAM, disk, load and network metrics start reporting on their own, with alerts on a threshold, on drift from the server's normal, or on a disk fill-up forecast.
  • Save the commands from this guide as a scheduled task and choose how often it runs, from every minute to once a year. The agent runs it on every host you pick.
  • If a command fails, you get an alert right away by email, Slack, Discord, push (through your Pushover account) or SMS (through your Vonage account).
  • The output of every run is kept, so you can look back at what changed. On paid plans, AI can read the output and alert you only when it spots a problem.

Setting it up

  1. Add the server in the Zuzia dashboard and install the agent.
  2. Create a scheduled task with the check commands below, then choose the hosts and how often it runs.
  3. Choose your notification channels. Turn on maintenance mode during planned work so it doesn't trigger alerts.

Custom Module Status Monitoring Commands

Add these commands as scheduled tasks:

# Check loaded modules
lsmod | head -20

# Verify critical modules
lsmod | grep -E "ext4|xfs|network-module"

# Check for module errors
dmesg | grep -i "module.*error\|module.*fail" | tail -10

# View module information
modinfo critical-module-name

Best Practices

1. Monitor Module Status Continuously

Use Zuzia.app for continuous module status monitoring. Set up alerts before module issues become critical. Review module status regularly.

2. Prioritize Critical Modules

Focus monitoring on business-critical modules. Set up dedicated monitoring for critical modules. Configure immediate alerts for critical module failures.

3. Track Module Health

Monitor module behavior over time. Track module loading patterns. Review module error patterns.

Troubleshooting

Module Not Loading

When modules fail to load:

  1. Check module status: lsmod | grep module-name
  2. Review kernel messages: dmesg | grep module-name
  3. Verify module files exist: find /lib/modules -name "module-name.ko"

Module Dependency Issues

When module dependencies fail:

  1. Check dependencies: modinfo module-name | grep depends
  2. Verify dependency status: lsmod | grep dependency-name
  3. Load dependencies first: modprobe dependency-name

FAQ

How often should I check kernel module status?

For production servers, check module status every 10-15 minutes. Zuzia.app can check status automatically and alert when module failures occur.

What kernel modules should I monitor?

Monitor all production modules, especially critical modules like filesystem modules, network modules, and hardware driver modules.

Can Zuzia.app detect kernel module loading failures?

Yes, Zuzia.app can detect module loading failures by monitoring kernel messages, checking module status, tracking loading attempts, and alerting when modules fail to load.

Related guides, recipes, and problems

We use cookies to ensure the proper functioning of our website.