devlink-health - Linux


Overview

devlink-health is a command-line tool used to monitor and diagnose the health of Linux network devices managed by the Device Link (devlink) subsystem. It provides a comprehensive set of diagnostic capabilities to help identify and troubleshoot network issues.

Syntax

devlink-health [options] [command] <device>

Commands

  • stats: Display interface health statistics.
  • txstats: Display TX queue statistics.
  • rxstats: Display RX queue statistics.
  • coalesce: Display interrupt coalescing statistics.
  • errors: Display interface error events.
  • offload: Display offload statistics.
  • txsch: Display TX scheduler statistics.
  • rxsch: Display RX scheduler statistics.
  • tc_info: Display traffic control (TC) statistics.
  • crosslinks: Display crosslink statistics.

Options/Flags

  • -h, –help: Show help message.
  • -v, –verbose: Increase verbosity level.
  • -j, –json: Output statistics in JSON format.
  • -c, –count : Limit the number of statistics displayed.
  • -p, –paused: Suspend all statistics printing until Enter is pressed.
  • -m, –history: Keep history of past statistics.
  • -q, –rxqueues: Display RX queue-specific statistics.
  • -t, –txqueues: Display TX queue-specific statistics.
  • -r, –rate: Print statistics at a specified rate.
  • -f, –filter: Filter statistics based on a condition.
  • -n, –no-headers: Suppress printing of header lines.

Examples

Display interface health statistics

devlink-health stats eth0

Display RX queue statistics for specific queues

devlink-health rxstats -q 1-4 eth0

Monitor TX queue statistics with updated rate

devlink-health -r 10 -t txstats eth0

Common Issues

No statistics available

If devlink-health does not display any statistics, check if the device is properly managed by devlink. Use devlink dev info <device> to verify.

Integration

devlink-health can be integrated with scripts or other commands to automate monitoring and fault detection tasks. For example, it can be used in conjunction with watch to continuously monitor network health:

watch -n 5 devlink-health stats eth0

Related Commands

  • devlink: Device Link subsystem management tool.
  • ethtool: Ethernet device monitoring and statistics tool.
  • tc: Traffic control configuration tool.