How do I monitor the usage of license keys for MATLAB and toolboxes?

370 views (last 30 days)
I would like to monitor the usage (number of users) of license keys for MATLAB and other MathWorks products.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 6 Jun 2023
Edited: MathWorks Support Team on 6 Jun 2023
If you have a network license, there are several ways to monitor license usage:
  • LMSTAT
  • Log File
  • Flexera Software

LMSTAT

To check current license usage, you can use the lmstat function 
The lmstat function will display the following information:
  • Username of person that checked out the license.
  • Hostname of computer that the license was checked out on.
  • Date and time that license was checked out.
To use the lmstat function, open Terminal and run the following commands.
Linux:
cd $MATLABROOT/etc/glnxa64
./lmutil lmstat -a
MacOS:
cd $MATLAB/etc/maci64
./lmutil lmstat -a
Windows:
  1. Open the folder $MATLABROOT\etc\win64
  2. Run "lmtools.exe".
  3. Go to the "Server Status" tab.
  4. Click on "Perform Status Enquiry".
Alternatively, you can open Command Prompt and run the following commands.
cd $MATLABROOT\etc\win64lmutil lmstat -c license.dat -a
By default, $MATLABROOT = C:\Program Files\MATLAB\R20XXx
If you cannot find the above directories, you may not be on the license server. Please refer to following support article:Is there a way for licenses to be monitored from the client machine instead of the server?
For more information about lmtools and lmstat, please see the following documentation:

Log File

For a long-term record of license usage, view the license manager log file.
By default, every time the license manager is restarted, the log file gets overwritten. To append entries to the log file rather than overwrite them, please follow the instructions from the link below:
 
The network license manager log file will show license check-ins and check-outs:
  • When someone starts using a product, it checks out a key.
  • When someone stops using a product, it checks the key back in
The following are the default locations for each supported operating system:
Linux:
/var/tmp/lm_TMW.log
MacOS:
/var/tmp/lm_TMW.log
Windows:
$MATLABROOT\etc\lmlog.txt
You can also view the log file on Windows in lmtools.exe.
  1. Go to "Config Services" tab.
  2. Click on "View Log".
The log will be displayed in a pop-up window.
Example of lmlog.txt:
11:40:22 (lmgrd) -----------------------------------------------
11:40:22 (lmgrd) Please Note:
11:40:22 (lmgrd)
11:40:22 (lmgrd) This log is intended for debug purposes only.
11:40:22 (lmgrd) There are many details in licensing policies
11:40:22 (lmgrd) that are not reported in the information logged
11:40:22 (lmgrd) here, so if you use this log file for any kind
11:40:22 (lmgrd) of usage reporting you will generally produce
11:40:22 (lmgrd) incorrect results.
11:40:22 (lmgrd)
11:40:22 (lmgrd) -----------------------------------------------
11:40:22 (lmgrd)
11:40:22 (lmgrd)
11:40:22 (lmgrd) Done rereading
11:40:22 (lmgrd) FLEXnet Licensing (v11.4.0.0 build 31341) started on license_server (IBM PC) (4/20/2008)
11:40:22 (lmgrd) Copyright (c) 1988-2006 Acresso Software Inc. All Rights Reserved.
11:40:22 (lmgrd) US Patents 5,390,297 and 5,671,412.
11:40:22 (lmgrd) World Wide Web: http://www.acresso.com11:40:22 (lmgrd) License file(s): C:\Program Files\MATLAB\R2007a\flexlm\license.dat
11:40:22 (lmgrd) lmgrd tcp-port 27000
11:40:22 (lmgrd) Starting vendor daemons ...
11:40:22 (lmgrd) Started MLM (pid 10216)
11:40:22 (MLM) Server started on license_server for:MATLAB
11:40:22 (MLM) SIMULINK
11:40:22 (lmgrd) MLM using TCP-port 1253
11:40:24 (MLM) OUT: "MATLAB" jsmith@license_server
11:51:04 (MLM) IN: "MATLAB" jsmith@license_server
12:18:07 (MLM) OUT: "MATLAB" jsmith@license_server
12:20:25 (MLM) OUT: "SIMULINK" jsmith@license_server
This logfile indicates that the user jsmith took out a MATLAB key from the server license_server at 11:40 and that it was returned at 11:51 when he exited MATLAB. Then, at 12:18 he took out a MATLAB key again, and this time, took out a SIMULINK key at 12:20.

Flexra Software (Not Provided by MathWorks)

Flexera Software offers FlexNet Manager, which is software used for tracking and monitoring license usage. 
For more information, please visit Flexera's website:
  6 Comments
Walter Roberson
Walter Roberson on 30 Jan 2019
Back when I administered a license server, the logging tools provided with FlexLM were not good at statistics, and it was understood that if you needed real statistics that you needed to buy a third party monitoring package.
Walter Roberson
Walter Roberson on 22 May 2022
In that situation, you are going to need to write software to parse the license logs yourself, or else you are going to need to purchase flexera license monitoring software. The flexera license monitoring software that Flexera makes available is limited to showing what licenses are currently in use and who is using them, and is completely incapable of providing any kind of historical information.
It might possibly be the case that Flexera has improved their logs since the days when they were called FlexLM and I dealt with their logs. Back when I was dealing with their logs, the logs lost track of information. It was necessary to analyze carefully to look for signs of a license manager restart, to know to flush any information you had accumulated about who has which license checked out. It was also necessary to compare keys closely to notice that the same person was checking out the exact same license key -- implying that at some point between that they must have released the license key even though it did not get logged.
Back then, in order to get reliable analysis, third party companies provided software that effectively intercepted calls between the master license daemon and the MATLAB license daemon, and maintained their own information database. It was a luxary that we could not afford, so I did the best I could with using perl or somethng like that to analyze the logs (and correlate against system reboots, and things like that...)

Sign in to comment.

More Answers (0)

Categories

Find more on Manage Products in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!