Skip to content

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Device Monitoring Utility (DMON)

Introduction

While working with various connected hardware / devices on a daily basis:

  • I found it hard to manually scan through the flickering Windows Device Manager UI for device updates
  • USB View briefly highlights events but does not provide running logs.

I built this handy tool with inspiration from dmesg and udevadm on Linux. It detects device attach & remove events in real time, renders in a live terminal table and logs full device details.

I find this really easy on my eyes while looking for device events and updates to the COM interfaces.

DMON CLI

Installation

Download a binary

Grab the latest release for your platform from the Releases page.

Platform Binary
Windows dmon.exe
Linux dmon

Build from source

Requires Go 1.22+.

git clone https://github.com/biswajee/dmon.git
cd dmon
go build -o dmon .          # Linux
go build -o dmon.exe .      # Windows

Usage

dmon [flags]

Flags:
  -v              Minimal output: ID, name, port
  -vv             Standard output: + manufacturer, product, serial  (default)
  -vvv            Verbose output: + USB endpoints
  -log <path>     Log file path  (default: dmon.log)
  -help           Show this message

Examples

Command Description
dmon Live terminal table, default verbosity
dmon -v Live terminal table, minimal output
dmon -vvv Live terminal table with USB endpoint detail
dmon -v -log /var/log/dmon.log Minimal display, custom log path

Press Ctrl-C to stop.

Monitor output

  ██████╗ ███╗   ███╗ ██████╗ ███╗   ██╗
  ██╔══██╗████╗ ████║██╔═══██╗████╗  ██║
  ██║  ██║██╔████╔██║██║   ██║██╔██╗ ██║
  ██║  ██║██║╚██╔╝██║██║   ██║██║╚██╗██║
  ██████╔╝██║ ╚═╝ ██║╚██████╔╝██║ ╚████║
  ╚═════╝ ╚═╝     ╚═╝ ╚═════╝ ╚═╝  ╚═══╝
  device monitor

  dmon  ·  connected devices   2026-06-09  14:22:01

┌────────────────────┬──────────────────────────┬──────────┬──────────────────┬────────────────┐
│ Device ID          │ Name                     │ Port     │ Manufacturer     │ Serial         │
├────────────────────┼──────────────────────────┼──────────┼──────────────────┼────────────────┤
│ VID:0403 PID:6001  │ FTDI USB Serial Converter│ COM3     │ FTDI             │ FT1ABC23       │
│ VID:05AC PID:0250  │ Apple USB Mouse          │ -        │ Apple Inc.       │                │
└────────────────────┴──────────────────────────┴──────────┴──────────────────┴────────────────┘

  ────────────────────────────────────────────────────────────────
  recent events
  14:22:01  [+]  ATTACHED  FTDI USB Serial Converter  COM3
  14:21:45  [+]  ATTACHED  Apple USB Mouse

New device rows are highlighted green. Removed rows flash red briefly before disappearing.

Flag Table shows Footer shows
-v ID, Name, Port symbol + name
-vv + Manufacturer, Serial + timestamp, action, port
-vvv + USB endpoint sub-rows + timestamp, action, port

Log file

Events are written in append mode and survive restarts. Remove events include the full detail captured at attach time.

2026-06-09T14:22:01Z  ATTACHED  VID:0403 PID:6001  FTDI USB Serial Converter (COM3)
  manufacturer  : FTDI
  product       : USB Serial Converter
  serial        : FT1ABC23
  port          : COM3
  endpoints     : EP0x81  IN   Bulk   64B
                  EP0x02  OUT  Bulk   64B

2026-06-09T14:30:45Z  REMOVED   VID:0403 PID:6001  FTDI USB Serial Converter (COM3)
  manufacturer  : FTDI
  product       : USB Serial Converter
  serial        : FT1ABC23
  port          : COM3

Device fields

Field Windows source Linux source
VID / PID Device interface path ID_VENDOR_ID / ID_MODEL_ID uevent keys, sysfs fallback
Name Registry FriendlyName ID_MODEL uevent key
Manufacturer Registry Mfg sysfs manufacturer
Product Registry DeviceDesc sysfs product
Serial Device instance ID sysfs serial
Port cfgmgr32 device tree walk for PortName sysfs tty node walk
Endpoints IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX via parent hub sysfs ep_* directories

Platform notes

Windows - dmon creates a hidden message-only window (HWND_MESSAGE) and registers for WM_DEVICECHANGE with DEVICE_NOTIFY_ALL_INTERFACE_CLASSES. Runs as a normal user. Devices without a driver bound (shown as "Unknown Device" in Device Manager) do not fire WM_DEVICECHANGE and will not be detected.

Linux - dmon opens a NETLINK_KOBJECT_UEVENT socket and reads kernel uevent messages directly. No udevadm or libudev dependency. Works for driverless devices; VID/PID and name fields are populated from sysfs when udev keys are absent.

Contributing

  1. Fork the repository and create a feature/your-feature branch.
  2. Make your changes and ensure go test ./... passes.
  3. Open a pull request against develop.

CI runs lint (golangci-lint) and tests on both Ubuntu and Windows for every push and pull request.

License

MIT

About

Handy device monitoring CLI for Windows and Linux

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages