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. MonitorLM automatically supports IPv4 and IPv6 environments.

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 Linux or Mac). 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.

monitorlm command-line options.

If -file is not set, MonitorLM will write to stdout.

The three possible output formats in -format are as follows:

-format output formats.

The cgi format is used when MonitorLM is launched directly by a web browser.

This shows what the output of MonitorLM looks like, with -format set to text.

Online help is available at
http://reference.wolfram.com/network

MathLM Version 11.2 
MathLM Server hostname.domain.com 
Date : Thursday, August 29 2017 14:11:59 
	
License Usage Summary:

							License	Total	Total
Program						Class	in Use	Authorized
------------------------------------------------------

Mathematica					A		2		20
MathKernel					A		4		40


Sub Mathematica				A		0		80
Sub MathKernel				A		0		80

Licenses in Use:

							License
Program			Version		Class	Username	Hostname			Duration
----------------------------------------------------------------------------
Mathematica		11.1			A		username	client1.domain.com	08:49
Mathematica		11.2			A		username	client2.domain.com	06:33
MathKernel		11.1			A		username	client1.domain.com	08:44
MathKernel		11.2			A		username	client2.domain.com	06:52
MathKernel		11.2			A		username	client2.domain.com	06:52
MathKernel		11.2			A		username	client2.domain.com	06:30

This shows what the output of MonitorLM looks like in a web browser, with -format set to html.

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.

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.

Each tag in the template file has the form %var#, where

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 (%).

Predefined Constant Tags

Here are two tables of constant tag names that can be included in the template file along with the numeric values for their possible formats.

Date Constant Tags

The following are Date Constant Tags for MonitorLM.

MonitorLM Date Constant Tags.

Server and Process Constant Tags

The following are Server and Process Constant Tags for MonitorLM.

MonitorLM Server and Process Constant Tags.

Customizable Variable Tags

The following are Customizable Variable Tags for MonitorLM.

MonitorLM Customizable Variable Tags.

Process-Dependent Tags

The following are Process-Dependent Tags for MonitorLM.

MonitorLM Process-Dependent Tags.

Repeated Tags

The following are Repeated Tags for MonitorLM.

MonitorLM Repeated Tags.

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.

%TEXT
Time/Date : [%CONST_DATE_T2] [%CONST_DATE_M3 %CONST_DATE_D, %CONST_DATE_Y2]
Front End Processes Authorized: %CONST_TOTAL_FE_AUTHORIZED
Kernel Processes Authorized: %CONST_TOTAL_KE_AUTHORIZED
Front End Processes Available: %CONST_TOTAL_FE_AVAILABLE
Kernel Processes Available: %CONST_TOTAL_KE_AVAILABLE
Front End Processes In Use: %CONST_TOTAL_FE_OUT
Kernel Processes In Use: %CONST_TOTAL_KE_OUT

The resulting output has the form shown here.

Time/Date : [00:05:26] [October 20, 2010]
Front End Processes Authorized: 5
Kernel Processes Authorized: 5
Front End Processes Available: 4
Kernel Processes Available: 4
Front End Processes In Use: 1
Kernel Processes In Use: 1

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.

# Begin variable tag definitions
%VAR_MPROCESS = "FE" "KE" "SFE" "SKE"
%VAR_TOTAL_CHECKEDOUT_HEADER = "Slot\t Program\t User\t Host\n"
%REP_GENERAL_CHECKOUT_LINE = "%PROC_SLOTNUM\t %VAR_MPROCESS\t %PROC_USER\t %PROC_HOST\n"

%TEXT
Time/Date : [%CONST_DATE_T2] [%CONST_DATE_M3 %CONST_DATE_D, %CONST_DATE_Y2]
Front End Processes Authorized: %CONST_TOTAL_FE_AUTHORIZED
Kernel Processes Authorized: %CONST_TOTAL_KE_AUTHORIZED
Front End Processes Available: %CONST_TOTAL_FE_AVAILABLE
Kernel Processes Available: %CONST_TOTAL_KE_AVAILABLE
Front End Processes In Use: %CONST_TOTAL_FE_OUT
Kernel Processes In Use: %CONST_TOTAL_KE_OUT 

%VAR_TOTAL_CHECKEDOUT_HEADER
%REP_GENERAL_CHECKOUT_LINE

The resulting output has the form shown here.

Time/Date : [00:05:26] [October 20, 2010]
Front End Processes Authorized: 5
Kernel Processes Authorized: 5
Front End Processes Available: 4
Kernel Processes Available: 4
Front End Processes In Use: 1
Kernel Processes In Use: 1

Slot    Program   User       Host
6       FE        username   hostname
1       KE        username   hostname

The following example demonstrates HTML output. This is useful, for example, if you want to view the MonitorLM output in a web browser.

%VAR_MPROCESS = "FE" "KE" "SFE" "SKE"
%VAR_TOTAL_CHECKEDOUT_HEADER = "<TR><TD><B>Slot</B></TD> <TD><B>Program</B></TD> <TD><B>User</B></TD> <TD><B>FQDN</B></TD> </TR>\n"
%REP_GENERAL_CHECKOUT_LINE = "<TR> <TD>%PROC_SLOTNUM</TD> <TD>%VAR_MPROCESS</TD> <TD>%PROC_USER</TD> <TD>%PROC_FQDN</TD> </TR>\n"

%TEXT
<HTML>
<HEAD> <TITLE> MathLM Status </TITLE> </HEAD>
<BODY>
<TABLE BORDER=1 CELLPADDING=5>
<TR><TD COLSPAN=2><B>MathLM Server</B></TD> <TD COLSPAN=2><B>%CONST_SERVER_FQDN</B></TD> </TR>
<TR><TD COLSPAN=2>Time/Date</TD> <TD COLSPAN=2>[%CONST_DATE_T2] [%CONST_DATE_M3 %CONST_DATE_D, %CONST_DATE_Y2]</TD> </TR>
<TR><TD COLSPAN=2>Authorized</TD> <TD>%CONST_TOTAL_FE_AUTHORIZED</TD> <TD>%CONST_TOTAL_KE_AUTHORIZED</TD></TR>
<TR><TD COLSPAN=2>Available</TD> <TD>%CONST_TOTAL_FE_AVAILABLE</TD> <TD>%CONST_TOTAL_KE_AVAILABLE</TD></TR>
<TR><TD COLSPAN=2>In Use</TD> <TD>%CONST_TOTAL_FE_OUT</TD> <TD>%CONST_TOTAL_KE_OUT</TD></TR>
 
%VAR_TOTAL_CHECKEDOUT_HEADER
%REP_GENERAL_CHECKOUT_LINE

</TABLE>
</BODY>
</HTML>

The resulting output has the form shown here.