This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Monitoring MathLM

What Is MonitorLM?

MonitorLM gives information on the total number of licenses available and checked out, the fully qualified domain name and username of those who have them checked out, and so on. MonitorLM can send output to the terminal, open a web browser, or write to a file. The output for MonitorLM is customizable by means of a configuration file.

Starting MonitorLM

To start MonitorLM, change directory to the location in which MathLM is installed, and type .\monitorlm servername (on Windows) or ./monitorlm servername (on Unix, Linux, or Mac OS X). The first argument of the monitorlm command specifies the name of the license server running MathLM. If you do not specify a server name explicitly, the local machine name is chosen as the default.

MonitorLM Command-Line Options

The following options are available using the monitorlm command. The syntax for specifying an option is monitorlm servername options.

-file file

Specifies the file to which output should be directed. If this option is not set, MonitorLM will write to stdout. The format of the output is determined by the -format option.

-format f

-localtime

-template file

This shows what the output of MonitorLM looks like, with -format set to text.
This shows what the output of MonitorLM looks like in a web browser, with -format set to html.
1.gif
Note that when -format is set to cgi, the output of MonitorLM is sent to stdout in HTML format. This shows what that output looks like when displayed in a web browser.
2.gif

Customizing the Output of MonitorLM

You can customize the content and format of the output from MonitorLM by editing a template file. This is a plain text file, which can contain the following types of elements.
  • Constant tags—These tags represent data that is static during the execution of MonitorLM and license-independent, such as the current date. Each of these tag names has the prefix CONST.
  • Variable tags—These tags act as wrappers to constant tags. They are useful in defining the format for data to be output in series, such as a table of current MathLM users. They are useful for improving readability of the template file. Each of these tag names has the prefix VAR.
  • Process-dependent tags—The value of these tags depends upon which Mathematica process is being displayed and includes data like the process owner's username and IP address. Each of these tag names has the prefix PROC.
  • Repeated tags—These tags serve as placeholders for information regarding an unknown number of licenses. They are the only tags whose size is not predetermined. Only the checkout lines are repeated, and there is one checkout line per license. Each of these tag names has the prefix REP.
  • Text wrappers—This is the text that a user can wrap around the tags, for presentation and formatting.
Each tag in the template file has the form %var#, where
  • var represents a variable whose value is provided by the server.
  • # is a number defining a specific format for the display of the variable var.
In addition to the %var# commands, the template file can also include plain text such as brackets, dashes, quotation marks, and arbitrary comments. The text can be used to include comments and separators in the server messages for formatting purposes. All text included in the string appears literally in the server message with the following two exceptions: use %q to include a double quote ("), and use %% to include a percentage sign (%).
Here is a list of tag names that can be included in the template file along with the numeric values for their possible formats.

Predefined Constant Tags

%CONST_DATE_D#

%CONST_DATE_W#

%CONST_DATE_M#

%CONST_DATE_Y#

%CONST_DATE_T#

%CONST_SERVER_IP

MathLM IP address.

%CONST_SERVER_HOST

MathLM hostname.

%CONST_SERVER_DOMAIN

MathLM domain.

%CONST_SERVER_FQDN

MathLM fully qualified domain name.

%CONST_SERVER_VERSION

MathLM version.

%CONST_CA_FE_AUTHORIZED

%CONST_CB_FE_AUTHORIZED

%CONST_TOTAL_FE_AUTHORIZED

%CONST_CA_KE_AUTHORIZED

%CONST_CB_KE_AUTHORIZED

%CONST_TOTAL_KE_AUTHORIZED

%CONST_CA_FE_AVAILABLE

%CONST_CB_FE_AVAILABLE

%CONST_TOTAL_FE_AVAILABLE

%CONST_CA_KE_AVAILABLE

%CONST_CB_KE_AVAILABLE

%CONST_TOTAL_KE_AVAILABLE

%CONST_CA_FE_OUT

%CONST_CB_FE_OUT

%CONST_TOTAL_FE_OUT

%CONST_CA_KE_OUT

%CONST_CB_KE_OUT

%CONST_TOTAL_KE_OUT

Customizable Variable Tags

Note: The strings provided in this section are examples of possible values, not default settings. To use these tags, you must define them in your template.

%VAR_DATE_AMPM = "A.M." "P.M."

%VAR_MPROCESS = "Front End" "Kernel"

%VAR_LIC_CLASS = "Class A" "Class B"

%VAR_CA_AUTHORIZED_HEADER = "Class A Authorized \t Front End \t Kernel"

%VAR_CB_AUTHORIZED_HEADER = "Class B Authorized \t Front End \t Kernel"

%VAR_TOTAL_AUTHORIZED_HEADER = "Total Authorized \t Front End \t Kernel"

%VAR_CA_CHECKEDOUT_HEADER = "Class A Licenses in Use\nUsername \t Hostname \t Program \t Slot # \t Duration"

%VAR_CB_CHECKEDOUT_HEADER = "Class B Licenses in Use\nUsername \t Hostname \t Program \t Slot # \t Duration"

%VAR_CHECKEDOUT_HEADER = "Licenses in Use\nUsername \t Hostname \t Program \t License Class \t Slot # \t Duration"

Process-Dependent Tags

%PROC_UID

%PROC_USER

%PROC_IP

%PROC_HOST

%PROC_DOMAIN

%PROC_FQDN

%PROC_SLOTNUM

%PROC_VERSION

%PROC_DURATION

Repeated Tags

Note: The strings provided in this section are examples of possible values, not default settings. To use these tags, you must define them in your template.

%REP_CA_CHECKOUT_LINE = "%PROC_USER \t %PROC_HOST \t %VAR_MPROCESS \t %PROC_SLOTNUM \t %PROC_DURATION\n"

%REP_CB_CHECKOUT_LINE = "%PROC_USER \t %PROC_HOST \t %VAR_MPROCESS \t %PROC_SLOTNUM \t %PROC_DURATION\n"

%REP_GENERAL_CHECKOUT_LINE = "%PROC_USER \t %PROC_HOST \t %VAR_MPROCESS \t %VAR_LIC_CLASS \t %PROC_SLOTNUM \t %PROC_DURATION\n"

In the template file, the text wrappers and tags that make up the output to MonitorLM must follow a line containing only the keyword %TEXT with no whitespace before or after it. Definitions for customized variable tags must precede the %TEXT line. If no variable tags are customized, the %TEXT line can be the first line of the file.

Samples and Behavior

Here is a simple text file that shows only the number of processes authorized, available, and in use. This example does not need to define any variable definition tags.
The resulting output has the form shown here.
Here is a slightly more sophisticated example. It is identical to the preceding example except that it also lists the processes in use and customizes variable tags.
The resulting output has the form shown here.
The following example demonstrates HTML output. This is useful, for example, if you want to view the MonitorLM output in a web browser.
The resulting output has the form shown here.
3.gif