CLI Reference
This reference documents all command-line options for the License Monitor executable.
Synopsis
Section titled “Synopsis”license_monitor [OPTIONS]license_monitor --self-update [UPDATE_OPTIONS]license_monitor --helplicense_monitor --versionGeneral Options
Section titled “General Options”| Option | Short | Description |
|---|---|---|
--help | -h | Print help information |
--version | -V | Print version information |
--config <FILE> | -c | Path to configuration file |
--debug | -d | Run in debug mode (output to stdout) |
--daemon | -x | Run in daemon mode (output to log file) |
--level <LEVEL> | -l | Log level (error, warn, info, debug, trace) |
Mode Selection
Section titled “Mode Selection”| Option | Short | Description |
|---|---|---|
--mode <MODE> | -m | Operating mode: command, tail, api, or both |
Mode Details
Section titled “Mode Details”| Mode | Description |
|---|---|
command | Execute commands periodically, includes API server |
tail | Monitor log file in real-time |
api | API server only |
both | Combined command and tail modes |
Command Mode Options
Section titled “Command Mode Options”| Option | Short | Description | Default |
|---|---|---|---|
--execute <CMD> | -e | Command to execute | Required |
--interval <SEC> | -i | Execution interval in seconds | 300 |
--no-api | Disable integrated API server | API enabled |
Examples
Section titled “Examples”# Basic command modelicense_monitor --mode command --execute "lmstat -a" --interval 300
# Command mode without APIlicense_monitor --mode command --execute "lmstat -a" --no-api
# With custom intervallicense_monitor --mode command --execute "lmstat -a" --interval 60Tail Mode Options
Section titled “Tail Mode Options”| Option | Short | Description | Default |
|---|---|---|---|
--file <PATH> | -f | Log file to monitor | Required |
--regex <PATTERN> | -r | Regex pattern for parsing | None |
--batch-size <N> | -b | Batch processing size | 10 |
Examples
Section titled “Examples”# Basic tail modelicense_monitor --mode tail --file /var/log/lmstat.log
# With regex parsinglicense_monitor --mode tail \ --file /var/log/lmstat.log \ --regex "^(\d{4}-\d{2}-\d{2})"
# With batch processinglicense_monitor --mode tail \ --file /var/log/lmstat.log \ --batch-size 50API Server Options
Section titled “API Server Options”| Option | Description | Default |
|---|---|---|
--api-host <HOST> | API server bind address | 127.0.0.1 |
--api-port <PORT> | API server bind port | 8080 |
--no-api | Disable API server | API enabled |
Examples
Section titled “Examples”# API mode onlylicense_monitor --mode api --api-host 0.0.0.0 --api-port 8080
# Custom portlicense_monitor --mode command --execute "lmstat -a" --api-port 9090Self-Update Options
Section titled “Self-Update Options”| Option | Description |
|---|---|
--self-update | Run the self-update process |
--check | Check for updates only (exit code 10 if available) |
--channel <CHANNEL> | Update channel: stable or beta |
--force | Force update even if versions match |
--rollback | Revert to previous version |
--token <TOKEN> | GitHub token for private repos |
--quiet | Suppress progress output |
--notes | Print release notes summary |
Examples
Section titled “Examples”# Check for updateslicense_monitor --self-update --check
# Update to latest stablelicense_monitor --self-update
# Update to beta channellicense_monitor --self-update --channel beta
# Force updatelicense_monitor --self-update --force
# Rollback to previous versionlicense_monitor --self-update --rollback
# Check with quiet outputlicense_monitor --self-update --check --quietecho $? # 0 = up to date, 10 = update availableLogging Options
Section titled “Logging Options”| Option | Short | Description |
|---|---|---|
--level <LEVEL> | -l | Set log level |
--debug | -d | Output to stdout (debug mode) |
--daemon | -x | Output to log file (daemon mode) |
Log Levels
Section titled “Log Levels”| Level | Description |
|---|---|
error | Errors only |
warn | Warnings and errors |
info | Informational messages |
debug | Debug information |
trace | Detailed tracing (verbose) |
Examples
Section titled “Examples”# Debug mode with verbose logginglicense_monitor --debug --level debug
# Daemon mode with info logginglicense_monitor --daemon --level info
# Production (warnings only)license_monitor --daemon --level warnConfiguration Priority
Section titled “Configuration Priority”Options are applied in this priority (highest first):
- Command-line arguments
- Environment variables
- Configuration file
- Default values
Example Priority
Section titled “Example Priority”# Command line overrides config filelicense_monitor \ --config /etc/license-monitor/config.toml \ --level debug # Overrides log_level in configExit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Configuration error |
| 10 | Update available (with —check) |
| 130 | Interrupted (Ctrl+C) |
Environment Variables
Section titled “Environment Variables”CLI options can also be set via environment variables:
| Environment Variable | Equivalent Option |
|---|---|
LICENSE_MONITOR_CONFIG | --config |
LICENSE_MONITOR_MODE | --mode |
LICENSE_MONITOR_LOG_LEVEL | --level |
LICENSE_MONITOR_API_HOST | --api-host |
LICENSE_MONITOR_API_PORT | --api-port |
LICENSE_MONITOR_EXECUTE | --execute |
LICENSE_MONITOR_INTERVAL | --interval |
Complete Examples
Section titled “Complete Examples”Production Deployment
Section titled “Production Deployment”# systemd service command/usr/local/bin/license_monitor \ --config /etc/license-monitor/config.toml \ --mode command \ --execute "lmstat -a -c 27000@license-server" \ --interval 300 \ --daemon \ --level warnDevelopment Testing
Section titled “Development Testing”# Quick test with debug output/usr/local/bin/license_monitor \ --mode api \ --api-host 127.0.0.1 \ --api-port 8080 \ --debug \ --level debugCombined Mode
Section titled “Combined Mode”# Command + Tail with API/usr/local/bin/license_monitor \ --config /etc/license-monitor/config.toml \ --mode both \ --execute "lmstat -a" \ --file /var/log/flexlm/lmstat.log \ --daemonNext Steps
Section titled “Next Steps”- Configuration Reference - TOML configuration
- Environment Variables - All environment variables