📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP

inventory-monitor

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inventory-monitor

Asset Management with semi-auto discovery processes

10.1.5
Maintainers
1

Inventory Monitor

This project is designed to monitor and manage inventory assets, including their types, assignments, lifecycle statuses, and related contracts, services, invoices, and RMAs.

Table of Contents

Attachments

Mermaid Diagram

classDiagram
    class AssetType {
        CharField name
        SlugField slug
        CharField description
        ColorField color
    }

    class Asset {
        CharField serial
        CharField partnumber
        CharField asset_number
        CharField assignment_status
        CharField lifecycle_status
        ForeignKey assigned_object_type
        PositiveBigIntegerField assigned_object_id
        GenericForeignKey assigned_object
        ForeignKey inventory_item
        ForeignKey type
        ForeignKey order_contract
        CharField project
        CharField vendor
        PositiveIntegerField quantity
        DecimalField price
        DateField warranty_start
        DateField warranty_end
        TextField comments
    }

    class ComponentService {
        DateField service_start
        DateField service_end
        CharField service_param
        DecimalField service_price
        CharField service_category
        CharField service_category_vendor
        ForeignKey asset
        ForeignKey contract
        TextField comments
    }

    class Contract {
        CharField name
        CharField name_internal
        ForeignKey contractor
        CharField type
        DecimalField price
        DateField signed
        DateField accepted
        DateField invoicing_start
        DateField invoicing_end
        ForeignKey parent
        TextField comments
    }

    class Contractor {
        CharField name
        CharField company
        CharField address
        TextField comments
        ForeignKey tenant
    }

    class Invoice {
        CharField name
        CharField name_internal
        CharField project
        ForeignKey contract
        DecimalField price
        DateField invoicing_start
        DateField invoicing_end
        TextField comments
    }

    class Probe {
        DateTimeField time
        DateTimeField creation_time
        CharField device_descriptor
        CharField site_descriptor
        CharField location_descriptor
        CharField part
        CharField name
        CharField serial
        ForeignKey device
        ForeignKey site
        ForeignKey location
        TextField description
        TextField comments
        JSONField discovered_data
        CharField category
    }

    class RMA {
        CharField rma_number
        ForeignKey asset
        CharField original_serial
        CharField replacement_serial
        CharField status
        DateField date_issued
        DateField date_replaced
        TextField issue_description
        TextField vendor_response
    }

    AssetType --> Asset : type
    Asset --> ComponentService : asset
    Asset --> RMA : asset
    Asset --> Contract : order_contract
    ComponentService --> Contract : contract
    Contract --> Contractor : contractor
    Contract --> Invoice : contract
    Contractor --> Contract : contractor
    Invoice --> Contract : contract
    Probe --> Asset : asset

How the Data Model Works

  • Contractor

    • Represents an external company or individual providing services or assets.
    • Associated with multiple contracts (Contract).
  • Contract

    • Represents a business agreement, such as for purchasing assets or services.
    • Can have:
      • Multiple invoices (Invoice) for billing.
      • Subcontracts (Contract) for hierarchical contract management.
      • Assets (Asset) linked to the contract.
      • Services (ComponentService) provided as part of the contract.
  • Invoice

    • Linked to a contract, representing billing details.
    • Contains details about invoicing periods and project-specific billing.
  • Asset

    • Represents physical or logical assets involved in a project.
    • Includes details like serial number, price, vendor, warranty, and project association.
    • Linked to services (ComponentService) and devices, sites, locations, rack.
    • Can be linked with inventory items.
  • ComponentService

    • Represents services provided for an asset, such as maintenance or subscriptions.
    • Contains details about the service period, parameters, pricing, and service categories.
  • Probe

    • Represents measurements or data collection related to a device, site, or location.
    • Includes descriptors for identifying the context of the probe.

Example Data and Relationships

Scenario

  • A contractor named TechCorp signs a contract for supplying assets and providing maintenance services for a project.
  • The project involves purchasing routers and switches from TechCorp, with maintenance services for these assets.
  • The contract also includes invoicing for specific periods.

Data Example

Contractor

  • Name: TechCorp
  • Company: TechCorp Ltd.
  • Address: 123 Main St, TechCity
  • Tenant: Default Tenant

Contract

  • Name: Network Infrastructure Supply
  • Type: Supply and Maintenance
  • Price: $100,000
  • Signed: 2025-01-01
  • Invoicing Start: 2025-01-15
  • Invoicing End: 2026-01-15

Invoice

  • Name: Invoice #001
  • Project: Project Alpha
  • Price: $25,000
  • Invoicing Start: 2025-01-15
  • Invoicing End: 2025-02-15

Asset

  • Serial: R12345
  • Part Number: RT-5000
  • Vendor: TechCorp
  • Price: $5,000
  • Warranty Start: 2025-01-15
  • Warranty End: 2028-01-15
  • Project: Project Alpha

ComponentService

  • Service Start: 2025-01-15
  • Service End: 2026-01-15
  • Service Param: Annual Maintenance
  • Service Price: $1,000
  • Service Category: Maintenance
  • Service Category Vendor: TechCorp

Probe

  • Time: 2025-02-01 10:00:00
  • Device Descriptor: RT-5000 Router
  • Site Descriptor: Data Center 1
  • Location Descriptor: Rack A1
  • Part: Router Module
  • Name: Temperature Check
  • Serial: R12345
  • Description: Router temperature measurement.

Relationship Example

  • TechCorp is linked to the Network Infrastructure Supply contract.
  • The contract includes:
    • An asset (router) with serial number R12345.
    • A service for annual maintenance of the router.
    • An invoice for January 2025 billing.
  • The asset is associated with:
    • A site (Data Center 1).
    • A location (Rack A1).
    • A device (RT-5000 Router).
  • A probe captures performance data (temperature) for the router at a specific time.

This structure enables easy tracking of assets, contracts, invoices, and services within the NetBox plugin.

Installation

To install the Inventory Monitor plugin, follow these steps:

  • Clone the repository:

    git clone https://gitlab.cesnet.cz/701/done/inventory-monitor-plugin.git
    cd inventory-monitor-plugin
    
  • Run the setup script:

    python setup.py install
    

OR

  • The plugin is available as a Python package on PyPI and can be installed with pip:
    pip install inventory-monitor 
    
  • To enable the plugin, add it to the PLUGINS list in your configuration.py:

    PLUGINS = [
        "inventory_monitor",
    ]
    
  • Run the database migrations:

    python manage.py migrate
    

Usage

To use the Inventory Monitor plugin, follow these steps:

  • Start the application:

    python manage.py runserver
    
  • Access the application in your web browser at http://localhost:8000.

Contributing

We welcome contributions to the Inventory Monitor project! To contribute, follow these steps:

  • Fork the repository.
  • Create a new branch for your feature or bugfix.
  • Make your changes and commit them with clear and concise messages.
  • Push your changes to your fork.
  • Submit a pull request to the main repository.

License

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

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts