Skip to content

A cross-platform USB device monitoring tool to log plug-in and removal events on Linux, Windows, and macOS. Create a tool that tracks when USB devices are plugged into a system.

License

Notifications You must be signed in to change notification settings

BaseMax/USB-device-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

USB Device Monitor

#Some Screenshots of it in action usb_monitor

A cross-platform Python script for monitoring USB device plug-in and removal events on Linux, Windows, and macOS.

Features

  • Logs USB device connections and disconnections.
  • Supports Linux, Windows, and macOS.
  • Outputs logs to both the console and a file (usb_monitor.log).
  • Graceful termination with Ctrl+C.

Requirements

Linux

  • Python 3.x
  • pyudev library

Windows

  • Python 3.x
  • pywin32 library

macOS

  • Python 3.x

Installation

  1. Clone the repository:

    git clone https://github.com/BaseMax/USB-device-monitor.git
    cd USB-device-monitor
  2. Install the required dependencies:

    pip install -r requirements.txt

Usage

Run the script directly:

python usb_device_monitor.py

The script will start monitoring USB devices and log events to the console and usb_monitor.log.

How It Works

  • Linux: Uses the pyudev library to monitor USB device events.
  • Windows: Utilizes the Windows API to handle USB device changes.
  • macOS: Leverages system_profiler to detect USB device state changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

© 2025 Max Base

GitHub: BaseMax

About

A cross-platform USB device monitoring tool to log plug-in and removal events on Linux, Windows, and macOS. Create a tool that tracks when USB devices are plugged into a system.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages