Skip to content

New Script Contribution - Python Hardware Resource Monitor with Cross-Platform Support #418

Open
@RETR0-OS

Description

@RETR0-OS

Description: Hardware Resource Monitor

Overview

This issue requests permission to add a Python-based hardware resource monitoring tool that provides real-time information about the system's hardware specifications and resource usage. The tool is designed to run continuously, similar to the Windows Task Manager, and displays data in a clean and user-friendly format in the console.

Features

  • GPU Monitoring:

    • Detects and displays GPU specifications, including:
      • GPU name
      • Total memory (in GB)
      • Used memory (in GB)
    • Supports NVIDIA GPUs using the pynvml library.
  • System Monitoring:

    • Detects and displays system specifications, including:
      • Total and used RAM (in GB)
      • Available disk space (in GB)
      • Number of CPU cores
      • CPU usage percentage
  • Continuous Monitoring:

    • Continuously monitors hardware resources with a customizable update interval.
    • Clears the console output on each update for a clean display.
  • Cross-Platform Compatibility:

    • Works on Windows, macOS, and Linux for CPU, RAM, and disk monitoring.
    • GPU monitoring is limited to systems with NVIDIA GPUs and the required drivers.

Changes Made

  1. Added the HardwareDetector class to handle hardware resource detection and monitoring.
  2. Implemented methods for:
    • GPU specifications detection (get_gpu_specs).
    • System specifications detection (get_computer_specs).
    • Continuous monitoring (monitor_resources).
  3. Included exception handling for graceful termination using KeyboardInterrupt.
  4. Updated the README.md with usage instructions and project details.
  5. Added a requirements.txt file for dependency management.

How to Use

  1. Install the required dependencies:

    pip install -r requirements.txt
  2. Run the script:

    python hardware_detector.py
  3. Press Ctrl+C to stop the monitoring process.

Notes

  • The GPU detection only works for Nvidia GPUs
  • The script clears the console output on each update. This behavior may vary depending on the operating system.

Testing

  • Verified functionality on Windows and Linux systems.
  • Tested with and without NVIDIA GPUs to ensure proper handling of GPU-related functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions