Configuration Reference
This reference documents all configuration options for License Monitor’s TOML configuration file.
Configuration File Location
Section titled “Configuration File Location”Default locations (in priority order):
- Path specified by
--configargument LICENSE_MONITOR_CONFIGenvironment variable./config.toml(current directory)/etc/license-monitor/config.toml
Complete Configuration Example
Section titled “Complete Configuration Example”# License Monitor Configuration File# All options with their default values
[command_mode]command = "lmstat -a"interval_seconds = 300timeout_seconds = 120parse_script = ""working_directory = ""
[tail_mode]log_file = ""regex_pattern = ""batch_size = 10follow = true
[api]enabled = truebind_address = "127.0.0.1"bind_port = 8080allow_public_bind = falseapi_key = ""require_auth = falserate_limit_enabled = truerate_limit_requests = 60rate_limit_window_seconds = 60cors_enabled = falsecors_origins = []cors_methods = ["GET", "POST", "OPTIONS"]cors_headers = ["Content-Type", "X-API-Key"]cors_max_age = 86400cors_credentials = falsemax_connections = 100read_timeout_seconds = 30write_timeout_seconds = 30idle_timeout_seconds = 60
[daemon]log_file = "logs/license_monitor.log"log_level = "warn"console_log_level = ""file_log_level = ""otel_log_level = ""log_format = "text"
[update]channel = "stable"auto_check = falserequire_signature = trueendpoint = "https://api.github.com"owner = ""repo = ""mirror_url = ""telemetry = falseCommand Mode Section
Section titled “Command Mode Section”Controls periodic command execution.
[command_mode]| Option | Type | Default | Description |
|---|---|---|---|
command | string | "" | Command to execute |
interval_seconds | integer | 300 | Execution interval (seconds) |
timeout_seconds | integer | 120 | Command timeout (seconds) |
parse_script | string | "" | Python script for output parsing |
working_directory | string | "" | Working directory for command |
Examples
Section titled “Examples”[command_mode]# Basic FlexLM querycommand = "lmstat -a -c 27000@license-server"interval_seconds = 300
# With parse scriptcommand = "lmstat -a"parse_script = "/etc/license-monitor/servers/flexlm/parse.py"
# RLM with longer timeoutcommand = "rlmstat -a -c 5053@rlm-server"timeout_seconds = 180Tail Mode Section
Section titled “Tail Mode Section”Controls log file monitoring.
[tail_mode]| Option | Type | Default | Description |
|---|---|---|---|
log_file | string | "" | Path to log file to monitor |
regex_pattern | string | "" | Regex for parsing log entries |
batch_size | integer | 10 | Number of lines to process per batch |
follow | boolean | true | Continue monitoring for new lines |
Examples
Section titled “Examples”[tail_mode]log_file = "/var/log/flexlm/lmstat.log"regex_pattern = "^(\\d{4}/\\d{2}/\\d{2} \\d{2}:\\d{2}:\\d{2})\\s+(\\w+)\\s+(.*)$"batch_size = 50follow = trueAPI Section
Section titled “API Section”Controls the web API server.
[api]Server Settings
Section titled “Server Settings”| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable API server |
bind_address | string | ”127.0.0.1” | IP address to bind |
bind_port | integer | 8080 | Port to bind |
allow_public_bind | boolean | false | Allow binding to 0.0.0.0 |
max_connections | integer | 100 | Maximum concurrent connections |
Authentication Settings
Section titled “Authentication Settings”| Option | Type | Default | Description |
|---|---|---|---|
api_key | string | "" | API key for authentication |
require_auth | boolean | false | Require authentication |
Timeout Settings
Section titled “Timeout Settings”| Option | Type | Default | Description |
|---|---|---|---|
read_timeout_seconds | integer | 30 | Request read timeout |
write_timeout_seconds | integer | 30 | Response write timeout |
idle_timeout_seconds | integer | 60 | Idle connection timeout |
Rate Limiting
Section titled “Rate Limiting”| Option | Type | Default | Description |
|---|---|---|---|
rate_limit_enabled | boolean | true | Enable rate limiting |
rate_limit_requests | integer | 60 | Requests per window |
rate_limit_window_seconds | integer | 60 | Rate limit window |
CORS Settings
Section titled “CORS Settings”| Option | Type | Default | Description |
|---|---|---|---|
cors_enabled | boolean | false | Enable CORS |
cors_origins | array | [] | Allowed origins |
cors_methods | array | [“GET”,“POST”,“OPTIONS”] | Allowed methods |
cors_headers | array | [“Content-Type”,“X-API-Key”] | Allowed headers |
cors_max_age | integer | 86400 | Preflight cache duration |
cors_credentials | boolean | false | Allow credentials |
Examples
Section titled “Examples”[api]enabled = truebind_address = "127.0.0.1"bind_port = 8080require_auth = falserate_limit_enabled = false[api]enabled = truebind_address = "127.0.0.1"bind_port = 8080allow_public_bind = falseapi_key = "${LICENSE_MONITOR_API_KEY}"require_auth = truerate_limit_enabled = truerate_limit_requests = 100rate_limit_window_seconds = 60cors_enabled = truecors_origins = ["https://dashboard.example.com"]cors_credentials = truemax_connections = 200Daemon Section
Section titled “Daemon Section”Controls logging and output.
[daemon]| Option | Type | Default | Description |
|---|---|---|---|
log_file | string | ”logs/license_monitor.log” | Log file path |
log_level | string | ”warn” | Default log level |
console_log_level | string | "" | Console-specific level |
file_log_level | string | "" | File-specific level |
otel_log_level | string | "" | OpenTelemetry level |
log_format | string | ”text” | Log format: text or json |
Log Levels
Section titled “Log Levels”| Level | Description |
|---|---|
error | Errors only |
warn | Warnings and above |
info | Informational and above |
debug | Debug and above |
trace | All messages |
Examples
Section titled “Examples”[daemon]log_file = "/var/log/license-monitor/license_monitor.log"log_level = "warn"
# JSON format for log aggregationlog_format = "json"
# Different levels per outputconsole_log_level = "info"file_log_level = "debug"otel_log_level = "warn"Update Section
Section titled “Update Section”Controls the self-update system.
[update]| Option | Type | Default | Description |
|---|---|---|---|
channel | string | ”stable” | Update channel: stable or beta |
auto_check | boolean | false | Enable automatic update checks |
require_signature | boolean | true | Require SHA-256 verification |
endpoint | string | ”https://api.github.com” | GitHub API endpoint |
owner | string | "" | Repository owner |
repo | string | "" | Repository name |
mirror_url | string | "" | Optional download mirror |
telemetry | boolean | false | Enable local update telemetry |
Examples
Section titled “Examples”[update]channel = "stable"auto_check = falserequire_signature = trueowner = "keithce"repo = "license_monitor"
# For private repos# Set GITHUB_TOKEN environment variable
# For air-gapped environmentsmirror_url = "https://internal-mirror.example.com/releases"Environment Variable Interpolation
Section titled “Environment Variable Interpolation”Configuration values can reference environment variables:
[api]api_key = "${LICENSE_MONITOR_API_KEY}"bind_address = "${LICENSE_MONITOR_HOST:-127.0.0.1}"bind_port = "${LICENSE_MONITOR_PORT:-8080}"Syntax:
${VAR}- Required variable${VAR:-default}- Variable with default value
Validation
Section titled “Validation”Validate configuration before deployment:
license_monitor --config config.toml --validateNext Steps
Section titled “Next Steps”- CLI Reference - Command-line options
- Environment Variables - All environment variables