Skip to content

Introduction

License Monitor is a comprehensive Rust-based utility designed for collecting, monitoring, and managing License Manager (LM) statistics across distributed server environments. It provides real-time monitoring, web API access, and centralized data collection with support for multiple license server types.

License Monitor serves as the backbone of the License Management project, providing:

  • Real-time Monitoring: Live log file monitoring with configurable parsing patterns
  • Command Execution: Periodic execution of license manager commands
  • Web API: Comprehensive REST API with WebSocket and Server-Sent Events support
  • Multi-server Support: Centralized data aggregation across multiple license servers
  • Self-management: Secure automatic updates via GitHub Releases
  • Observability: OpenTelemetry integration for metrics and logging

License Monitor follows a modular architecture with clear separation of concerns:

graph TB
subgraph "Core Components"
CM[Command Mode]
TM[Tail Mode]
API[API Server]
UP[Update System]
end
subgraph "Data Processing"
PP[Python Parser]
LP[Log Parser]
DP[Data Processor]
end
subgraph "External Systems"
LS[License Servers]
OTEL[OpenTelemetry]
GH[GitHub Releases]
WEB[Web Clients]
end
CM --> PP
TM --> LP
PP --> DP
LP --> DP
DP --> API
API --> WEB
UP --> GH
DP --> OTEL
CM --> LS
TM --> LS

License Monitor supports four distinct operational modes:

  1. Command Mode: Executes license manager commands periodically
  2. Tail Mode: Monitors log files in real-time
  3. API Mode: Runs only the web API server
  4. Both Mode: Combines command and tail modes with API server
  • Live Log Monitoring: File system notifications for real-time log processing
  • Command Execution: Configurable periodic command execution
  • Data Parsing: Python script integration for custom output parsing
  • Batch Processing: Efficient processing of log entries and command output
  • REST Endpoints: Complete API for license information and system metrics
  • WebSocket Support: Real-time bidirectional communication
  • Server-Sent Events: Unidirectional real-time data streaming
  • CORS Support: Configurable cross-origin resource sharing
  • Self-Update System: Secure automatic updates with signature verification
  • OpenTelemetry Integration: Comprehensive metrics and logging export
  • Configuration Management: Flexible TOML-based configuration
  • Security Features: API key authentication, rate limiting, and CORS protection
  • Cross-platform Support: Native support for Linux, Windows, and Unix systems

License Monitor supports multiple license server types:

  • Commands: lmstat, lmutil, lmver
  • Log Formats: Standard FlexLM log format
  • Features: License usage tracking, server status monitoring
  • Commands: rlmutil, rlmstat
  • Log Formats: RLM-specific log format
  • Features: License server health monitoring
  • Commands: Custom SES commands
  • Log Formats: SES-specific log format
  • Features: SES license management

The command mode engine handles periodic execution of license manager commands:

  • Scheduled Execution: Configurable intervals for command execution
  • Python Integration: Support for custom parsing scripts
  • Output Processing: Structured data extraction from command output
  • Error Handling: Robust error handling and retry logic

The tail mode engine provides real-time log file monitoring:

  • File System Notifications: Efficient file change detection
  • Regex Parsing: Configurable pattern matching for log entries
  • Batch Processing: Efficient processing of log entries
  • Rotation Support: Automatic handling of log file rotation

The API server provides comprehensive web access to License Monitor functionality:

  • REST API: Complete RESTful interface
  • WebSocket Support: Real-time bidirectional communication
  • Server-Sent Events: Unidirectional real-time streaming
  • Authentication: API key-based authentication
  • Rate Limiting: Configurable request rate limiting

The self-update system provides secure automatic updates:

  • GitHub Releases: Integration with GitHub Releases
  • Signature Verification: SHA-256 checksum verification
  • Channel Support: Stable and beta release channels
  • Background Checks: Non-blocking update availability checks
  • Concurrent Connections: Supports up to 1000 concurrent API connections
  • Memory Efficiency: Optimized memory usage with configurable limits
  • Thread Pool: Configurable thread pool for optimal performance
  • Batch Processing: Efficient batch processing of data
  • Error Recovery: Robust error handling and recovery mechanisms
  • Graceful Shutdown: Clean shutdown procedures
  • Health Monitoring: Comprehensive health check endpoints
  • Logging: Detailed logging for troubleshooting
  • API Key Authentication: Secure API key-based authentication
  • Token Validation: Comprehensive token validation
  • Session Management: Secure session handling
  • CORS Protection: Configurable cross-origin resource sharing
  • Rate Limiting: Request rate limiting per IP
  • IP Filtering: Suspicious IP blocking capabilities
  • Request Logging: Comprehensive request logging
  • Input Validation: Comprehensive input validation
  • Output Sanitization: Secure output sanitization
  • Error Handling: Secure error handling without information leakage

License Monitor integrates with OpenTelemetry for comprehensive observability:

  • Metrics Export: License usage metrics and system performance data
  • Log Export: Application logs with structured formatting
  • Trace Support: Distributed tracing capabilities
  • Custom Metrics: Configurable custom metrics

The self-update system integrates with GitHub Releases:

  • Automatic Updates: Secure automatic update downloads
  • Signature Verification: SHA-256 checksum verification
  • Release Channels: Support for stable and beta channels
  • Rollback Support: Ability to rollback to previous versions