Batch commands (flmprg)

Using the license manager batch feature allows you to run commands from a script file or in the batch console mode of the command.

Syntax

flmprg --batch [ help | action=command [ parameters ] [ ^indent= [ on | off ] ]  

Where:

  1. command can be an action to display information, manage licenses, and view active users, etc.
  2. parameters can be one or more parameters and values separated by the caret character (^). There is no space allowed before or after the caret.
    ^parameter=value[^...]
    There are various parameters to manage licensing:
    1. License information commands are described in Table 1.
    2. License management commands are described in Table 2.
    3. Commands using string licenses are described in Table 3.
    4. Active user management commands are described in Table 4.
Note: Caret character (^)
flmprg uses the caret character (^) for parsing.
flmprg --batch action=install-mkey^lnum=license_num^mkey=maintenance_or_subscription_key
In Windows® the caret is also used to escape special characters. To escape it, you may need to double (^^) it up.
flmprg --batch action=install-mkey^^lnum=license_num^^mkey=maintenance_or_subscription_key
Table 1. Information commands
Commands Description
action=target-info Display information about the operating system, such as w64v141, l64xl217, etc.
flmprg --batch action=target-info
action=product-info Display information about the product version.
action=license-info Display license information.
action=user-info Display active users information.
action=lm-info Display information on the license manager configuration.
action=up-info Check if a configured license manager is running and responding.
action=env-info Display environment / configuration information.
action=host-info Display host information.
flmprg --batch action=host-info
Optional parameters are:
  • host: Specify the host name.
    flmprg --batch action=host-info^host=myhost
  • all: Display information for all hosts. This is the default action.
    flmprg --batch action=host-info^host=all
Table 2. License management
Commands Description
action=install-license Install a license. Required parameters:
  • lnum: License number
  • lkey: License key.
  • mkey: (Optional) Maintenance/subscription key
Examples:
flmprg --batch action=install-license^lnum=XXX#XXXXXXXX^lkey=YYYYYYYYYYYY
flmprg --batch action=install-license^lnum=XXX#XXXXXXXX^lkey=YYYYYYYYYYYY^mkey=ZZZZZZZZZZZZ
action=uninstall-license Uninstall the license. The parameter lnum is a required with the license number.
flmprg --batch action=uninstall-license^lnum=XXX#XXXXXXXX
action=install-mkey Install a maintenance/subscription key. Required parameters:
  • lnum: License number
  • mkey: Maintenance/subscription key
flmprg --batch action=install-mkey^lnum=XXX#XXXXXXXX^mkey=YYYYYYYYYYYY
action=install-ikey Install an installation key (Activate the license). Required parameters:
  • lnum: License number
  • ikey: Installation key.
flmprg --batch action=install-ikey^lnum=XXX#XXXXXXXXX^ikey=XXXXXXXXXXXX
action=install-mkey-http Install a maintenance/subscription key using HTTP. Required parameters:
  • login: The customer code.
  • lnum: License number
Optional parameters:
  • proxy: Proxy host name
  • proxy-port: Proxy port, default is 3128
  • proxy-user: User name for proxy authentication.
  • proxy-password: Password for proxy authentication.
action=install-ikey-http Install an installation key using HTTP (Activate the license). Required parameters:
  • login: The customer code.
  • lnum: License number
Optional parameters:
  • proxy: Proxy host name
  • proxy-port: Proxy port, default is 3128
  • proxy-user: User name for proxy authentication.
  • proxy-password: Password for proxy authentication.
Table 3. License management (using license string)
Commands Description
action=decode-license-string Decode a license string. The parameter license-string is required with the license string to decode.
action=encode-license-string Encode a license string. Required parameters:
  • lnum: License number
  • lkey: License key.
  • mkey: Maintenance/subscription key
  • login: The customer code.
action=install-license-string Install a license in temporary mode using a license string. The parameter license-string is required with the license string to install.
action=install-license-string-http Install a license using a license string over HTTP. The parameter license-string is required with the license string to install.
Table 4. User management
Commands Description
action=check-users Check active users.
flmprg --batch action=check-users 
Optional parameters:
  • host: Check active users on a specified host.
    flmprg --batch action=check-users^host=myhost
  • all: Check active users on all hosts. This is the default action.
    flmprg --batch action=host-info^host=all
action=clear-sessions Clear all sessions.
flmprg --batch action=clear-sessions
Optional parameters:
  • lnum: Clear sessions for the specified license number.
    flmprg --batch action=clear-sessions^lnum=XXX#XXXXXXXX
  • all: Clear sessions for all licenses. This is the default action of the command.
    flmprg --batch action=clear-sessions^lnum=all
action=kill-session Kill session. Required parameter:
  • host: Kill sessions on the specified host.
    flmprg --batch action=kill-session^host=myhost
Optional parameter:
  • process-id: The process id to remove.
    flmprg --batch action=kill-session^host=myhost^process-id=123456

Usage

There are different ways of using batch commands, depending on your requirements.
  • You can write batch commands to script files, one command per line.
    flmprg --batch action=product-info 
    The script file can be executed directly to run the commands.
  • You can write batch commands to a JSON file, one command per line.
    {"action":"product-info"}
    The JSON file can be piped into a command to run the flmprg in batch console mode.
    flmprg --batch-console < myjsoncmds 
  • You can enter batch commands at the console of the flmprg running in batch console mode (flmprg --batch-console). For example, at the batch console prompt, enter the command to get information about flmprg:
    $ action=product-info
Running commands in Windows elevated command
In a Windows system, some flmprg commands will only work if run as administrator, and a Microsoft® User Account Control (UAC) prompt will be raised to open an elevated command terminal where you can complete the action. If you have not started the command terminal with "Run as Administrator", the following flmprg --batch commands will raise the UAC prompt:
  • action=install-license
  • action=uninstall-license
  • action=install-mkey or action=install-mkey-http
  • action=install-ikey or action=install-ikey-http
  • action=install-license-string or action=install-license-string-http
Commands will fail if you cancel the prompt and run without administrator privileges. If you are an administrator, or have administrator privileges, you can validate the UAC by clicking Yes. Once you have validated the UAC, an elevated command terminal is opened where you can complete the action.

If you need to disable the UAC prompt, you can set the environment variable FLM_BYPASS_UAC=1. Be aware that with the UAC prompt disabled, you will need to open a terminal with "Run as Administrator" to run commands that need administrator privileges.

Formatting the output

The output from commands is JSON formatted. You can enable / disable indentation on the output. If the output is to standard out, the output is indented by default. If you are piping the output to a file or redirection (no terminal), the output indentation is disabled by default. You can combine an indentation instruction with any batch action.

action=product-info^indent=on
Output is indented:
{
  "product": "flmprg",
  "version": "6.00.13",
  "wrtminver": "6.00.10",
  "build": "202301131121",
  "git-rev": "01e1199",
  "target": "w64v142",
  "status": 0,
  "status-msg": "Success."
}