Skip to content

CLI Reference

This reference documents all command-line options for the License Monitor executable.

Terminal window
license_monitor [OPTIONS]
license_monitor --self-update [UPDATE_OPTIONS]
license_monitor --help
license_monitor --version
OptionShortDescription
--help-hPrint help information
--version-VPrint version information
--config <FILE>-cPath to configuration file
--debug-dRun in debug mode (output to stdout)
--daemon-xRun in daemon mode (output to log file)
--level <LEVEL>-lLog level (error, warn, info, debug, trace)
OptionShortDescription
--mode <MODE>-mOperating mode: command, tail, api, or both
ModeDescription
commandExecute commands periodically, includes API server
tailMonitor log file in real-time
apiAPI server only
bothCombined command and tail modes
OptionShortDescriptionDefault
--execute <CMD>-eCommand to executeRequired
--interval <SEC>-iExecution interval in seconds300
--no-apiDisable integrated API serverAPI enabled
Terminal window
# Basic command mode
license_monitor --mode command --execute "lmstat -a" --interval 300
# Command mode without API
license_monitor --mode command --execute "lmstat -a" --no-api
# With custom interval
license_monitor --mode command --execute "lmstat -a" --interval 60
OptionShortDescriptionDefault
--file <PATH>-fLog file to monitorRequired
--regex <PATTERN>-rRegex pattern for parsingNone
--batch-size <N>-bBatch processing size10
Terminal window
# Basic tail mode
license_monitor --mode tail --file /var/log/lmstat.log
# With regex parsing
license_monitor --mode tail \
--file /var/log/lmstat.log \
--regex "^(\d{4}-\d{2}-\d{2})"
# With batch processing
license_monitor --mode tail \
--file /var/log/lmstat.log \
--batch-size 50
OptionDescriptionDefault
--api-host <HOST>API server bind address127.0.0.1
--api-port <PORT>API server bind port8080
--no-apiDisable API serverAPI enabled
Terminal window
# API mode only
license_monitor --mode api --api-host 0.0.0.0 --api-port 8080
# Custom port
license_monitor --mode command --execute "lmstat -a" --api-port 9090
OptionDescription
--self-updateRun the self-update process
--checkCheck for updates only (exit code 10 if available)
--channel <CHANNEL>Update channel: stable or beta
--forceForce update even if versions match
--rollbackRevert to previous version
--token <TOKEN>GitHub token for private repos
--quietSuppress progress output
--notesPrint release notes summary
Terminal window
# Check for updates
license_monitor --self-update --check
# Update to latest stable
license_monitor --self-update
# Update to beta channel
license_monitor --self-update --channel beta
# Force update
license_monitor --self-update --force
# Rollback to previous version
license_monitor --self-update --rollback
# Check with quiet output
license_monitor --self-update --check --quiet
echo $? # 0 = up to date, 10 = update available
OptionShortDescription
--level <LEVEL>-lSet log level
--debug-dOutput to stdout (debug mode)
--daemon-xOutput to log file (daemon mode)
LevelDescription
errorErrors only
warnWarnings and errors
infoInformational messages
debugDebug information
traceDetailed tracing (verbose)
Terminal window
# Debug mode with verbose logging
license_monitor --debug --level debug
# Daemon mode with info logging
license_monitor --daemon --level info
# Production (warnings only)
license_monitor --daemon --level warn

Options are applied in this priority (highest first):

  1. Command-line arguments
  2. Environment variables
  3. Configuration file
  4. Default values
Terminal window
# Command line overrides config file
license_monitor \
--config /etc/license-monitor/config.toml \
--level debug # Overrides log_level in config
CodeMeaning
0Success
1General error
2Configuration error
10Update available (with —check)
130Interrupted (Ctrl+C)

CLI options can also be set via environment variables:

Environment VariableEquivalent 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
Terminal window
# 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 warn
Terminal window
# Quick test with debug output
/usr/local/bin/license_monitor \
--mode api \
--api-host 127.0.0.1 \
--api-port 8080 \
--debug \
--level debug
Terminal window
# 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 \
--daemon