No description available
pip install fastpluggy-network-node
pip install fastpluggy-network-node==0.0.4
The Network Node plugin provides network discovery, monitoring, and analysis capabilities. It allows you to scan your local network for devices, identify services running on those devices, and collect information about network interfaces and WiFi networks.
pip install fastpluggy-network-node
This plugin follows the standard fastpluggy plugin structure:
- pyproject.toml
- Package configuration and metadata
- .gitlab-ci.yml
- CI/CD configuration
- src/
- Source code
- plugin.py
- Plugin entry point
- models.py
- Database models
- routers/
- API and frontend routers
- schema/
- API schemas
- services/
- Business logic
- tasks/
- Background tasks
- templates/
- HTML templates
This plugin depends on:
- fastpluggy-tasks-worker (>= 0.0.1) - For asynchronous task execution
- fastpluggy-websocket-tool (>= 0.0.1) - For real-time updates
- python-nmap - For network scanning
The plugin can be configured through the NetworkNodeConfig
class in config.py
. Key configuration options include:
# Common ports for scanning - most frequently used network service ports
COMMON_PORTS = [21, 22, 23, 25, 53, 80, 110, 111, 135, 139, 143, 443, 445, 993, 995, 1723, 3306, 3389, 5900, 8080]
# Scan configuration defaults
default_port_range: str = "1-1024"
default_scan_intensity: int = 3
default_timeout_seconds: int = 30
# Service detection configuration
enable_service_detection: bool = True
enable_os_detection: bool = False
enable_version_detection: bool = True
enable_script_scanning: bool = False
# Performance configuration
max_concurrent_scans: int = 10
scan_result_cache_ttl_minutes: int = 60
# UI configuration
default_view_mode: str = "cards" # cards or table
auto_refresh_interval_seconds: int = 300
The plugin includes functionality to identify device manufacturers from MAC addresses using OUI (Organizationally Unique Identifier) lookup. This feature is configured with the following settings in the NetworkNodeConfig
class:
# OUI lookup configuration
oui_data_url: str = "https://standards-oui.ieee.org/oui/oui.txt"
oui_data_directory: str = "/data/network_node/oui"
oui_data_file: str = "/data/network_node/oui/oui.txt"
oui_cache_ttl_days: int = 30 # How often to refresh the OUI data
The OUI data is downloaded from the IEEE's official registry and cached locally in the /data/network_node/oui/
directory. The cache is refreshed automatically based on the configured TTL.
To get the manufacturer of a device from its MAC address:
from fastpluggy_plugin.network_node.services.oui_lookup import OUILookup
# Get the manufacturer for a MAC address
mac_address = "00:11:22:33:44:55"
manufacturer = OUILookup.get_manufacturer_from_mac(mac_address)
print(f"Device manufacturer: {manufacturer}")
To discover devices on your local network:
from fastpluggy_plugin.network_node.tasks import network_discovery_task
# Discover devices on the local network
result = network_discovery_task(scan_method="ping")
print(result)
To scan for services on a specific device:
from fastpluggy_plugin.network_node.tasks import service_scan_task
# Scan for services on a specific IP address
ip_address = "192.168.1.100"
port_range = "1-1024"
result = service_scan_task(ip_address, port_range)
print(result)
To perform a complete network scan (discovery + service scanning):
from fastpluggy_plugin.network_node.tasks import full_network_scan_task
# Run a full network scan
result = full_network_scan_task()
print(result)
/data/network_node/oui/
directoryThe plugin provides API endpoints for accessing network data:
/api/network/nodes
/api/network/scan/status
/api/network/interfaces
/api/network/wifi/networks
The plugin provides web interfaces for viewing network data:
/network/dashboard
- Network dashboard/network/nodes
- Network nodes/network/services
- Network services/network/interfaces
- Network interfaces/network/wifi
- WiFi networksThe original tasks.py
file has been refactored into a proper Python module with the following structure:
network_node/
└── tasks/
├── __init__.py # Module initialization and exports
├── discovery.py # Network node discovery functionality
├── service_scan.py # Service scanning functionality
├── README.md # Module documentation
└── CHANGES.md # This file
Created a Module Structure
- Created a tasks
directory within the network_node
module
- Added an __init__.py
file to make it a proper Python module
- Organized imports and exports in the __init__.py
file
Split Functionality
- Moved network discovery functions to discovery.py
- Moved service scanning functions to service_scan.py
- Maintained the same function signatures for backward compatibility
Improved Import Handling
- Added proper error handling for optional dependencies
- Used conditional imports to avoid circular dependencies
- Added the TASKS_WORKER_AVAILABLE
flag to check for task worker availability
Added Documentation
- Created a comprehensive README.md with module structure and usage examples
- Added this CHANGES.md file to document the refactoring process
Better Organization
- Clear separation of concerns between discovery and service scanning
- Easier to understand and maintain the codebase
Improved Imports
- More explicit imports make dependencies clearer
- Reduced risk of circular imports
Better Documentation
- Comprehensive documentation of the module structure and usage
- Examples for common use cases
The refactoring maintains backward compatibility by:
__init__.py
fileThe module can be used the same way as before:
from src.domains.network_node.tasks import network_discovery_task, service_scan_task
Or with more explicit imports:
from src.domains.network_node.tasks.discovery import network_discovery_task
from src.domains.network_node.tasks.service_scan import service_scan_task
API documentation for this plugin is not available.
Last analysis performed: 2025-08-14 14:10:16
This plugin has a valid entry point:
network_node
= fastpluggy_plugin.network_node.plugin:NetworkNodePlugin
No issues were found during the analysis of this package.
fastpluggy_plugin.network_node.plugin:NetworkNodePlugin