Using "lmutil lmstat" to check License Mgr v10.+ status on a remote machine (solution)

46287
23
06-24-2010 10:17 AM
RebeccaStrauch__GISP
MVP Emeritus

updated Feb 20, 2018

This is to help anyone that may use the "lmutil" command line utility to check the status of concurrent license usage on a remote machine (i.e. from a local, non license manager (LM) machine).  Several things have changed from the 9.3.1 LM to the v10 LM and minor changes are needed to get this to work (at least with the LM release with the beta/release candidate).

Syntax we used in 9.3.1

lmutil lmstat -a -c   "\\<IP to out LM server>\Program Files\ESRI\License\arcgis9x\ArcINFO9.lic"

or "....\viewer9.lic".    This command would list all the licenses available and in use for that particular LM server.

Syntax we need to use in version 10

lmutil lmstat -a -c   "\\<IP to out LM server>\Program Files\ArcGIS\License10.0\bin\service.txt"

Beside the path/location and file name, the file format has also changed for the ArcGIS 10 license manager.  They replaced the multiple <product>.lic files with the service.txt which makes it much easier when you have to lock the LM to a port (for firewall issues) --- one file to deal with instead of multiple.    However, the one problem I ran into is that the default/generic "this_host" prevented the lmutil command from looking at the remote LM machine.  Instead, it responded that the license manager was not running on my <current machine name>. The quick fix is to change "this_host" to your LM server's name or IP address in the services.txt file.  At least that fixed it for me.

BTW - the command line syntax above assumes you are in a directory that can run lmutil, i.e.,either beacuse 1) it's in your path, 2) you have the lmutil.exe copied to your current directory, or 3) you are in the "C:\Program Files\ArcGIS\License10.0\bin" directory.

This was logged as a "bug" with this work around as the solution:
[#NIM058540  The command "lmutil lmstat" does not function properly for remote systems in License Manager 10 ]

Edit the service.txt file as follows:
Old - "SERVER this_host ANY"
New - "SERVER <hostname> ANY"

Hopefully this will save someone else using the lmutil a little time when making the switch.  -b

----

UPDATE (works with 10.4.x license manager too), now I just use:

lmutil lmstat -a -c @<servername>

with the @ sign, but  <server> will be the location of your license manager.   I have a copy of the lmutil,exe in the same folder as I create a  chk_lic.bat file with the line above.

EDIT: February 2018.  Someone was looking for the WhereDidAllTheLicensesGo by Julie Skuba (whose profile does not look active) on the ideas page Add new functionality to License Manager - Usage &amp; Analysis Tools .  It seems all the links for download of this tool are broken right now.  I found a version from 2004 that I zipped, but didn't see a way to upload it to the ideas page, so I will add to this post for others.  I am not the author of this script, and there may be other posts on the tweaks that are needed for newer LM versions...just posting here as a courtesy. 

23 Replies
AndresCastillo
MVP Regular Contributor

I am putting this in the bat file:

lmutil.exe lmstat -a -c @ip> ESRILicenseUse.txt

When I run, I get this .NET Exception:

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.ArrayList.get_Item(Int32 index)
   at ESRILicenseUse.frmESRILicenses.FormRefresh()
   at ESRILicenseUse.frmESRILicenses.GetLicenseUse()
   at ESRILicenseUse.frmESRILicenses.frmESRILicenses_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9043 (WinRelRS5.050727-9000)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
ESRILicenseUse
    Assembly Version: 1.0.1741.15468
    Win32 Version: 1.0.1741.15468
    CodeBase: file:///C:/Users/AXC013O/Downloads/WHATLG_from2004/WhereHaveAllTheLicensesGone.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9038 (WinRelRS5.050727-9000)
    CodeBase: file:///C:/windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9042 (WinRelRS5.050727-9000)
    CodeBase: file:///C:/windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9031 (WinRelRS5.050727-9000)
    CodeBase: file:///C:/windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 8.0.0.0
    Win32 Version: 8.0.50727.9031 (WinRelRS5.050727-9000)
    CodeBase: file:///C:/windows/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

The output text file, ESRILicenseUse.txt, yields:

lmutil - Copyright (C) 1989-2002 Globetrotter Software, Inc.
Flexible License Manager status on Wed 3/18/2020 15:06

[Detecting lmgrd processes...]
License server status: 27000@ip
    License file(s) on ip: C:\Program Files (x86)\ArcGIS\LicenseManager\bin\service.txt:

ip: license server UP v11.16

Vendor daemon status (on serverHostname):



----------------------------------------------------------------------------
License server status: 27001@localHostname
    License file(s) on localHostname: 27000@ip;27001@ip:

lmgrd is not running: Cannot connect to license server (-15,570)
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Of course, I replaced the actual values of the ip, serverHostname, and localHostname for this post.

0 Kudos
curtvprice
MVP Esteemed Contributor

Here's a lower-tech alternative to Where have all the licenses gone  app that I just posted

List concurrent licenses script

AndresCastillo
MVP Regular Contributor

Beautiful Curtis, so beautiful.

0 Kudos
AndresCastillo
MVP Regular Contributor

The issue I had was that the lmutil.exe that came with the attached zip download provided by Rebecca Strauch, GISP‌ was not the most recent (which makes sense, considering this post is from 2010).

In order to get the most recent lmutil.exe, I downloaded ArcGIS License Manager from My Esri to my local machine.

Check that the downloaded file matches the checksum provided by Esri to ensure the file downloaded correctly:

How To: How and when to use CheckSum (MD5) 

Extract the files to C:\\users\<name>\Documents\License Manager 2019.2\LicenseManager\Setup.exe , and run the Setup.exe file.

This allowed me to get the most recent version of lmutil.exe:

C:\Program Files (x86)\ArcGIS\LicenseManager\bin\lmutil.exe

I copied and pasted that exe to the same directory as the downloaded program from Rebecca Strauch, GISP (Thank you Rebecca!!!), and it works!

Note that I won't be using the License Server Administrator Desktop App for any other reason on my local desktop than the one mentioned above.

If you do not have access to My Esri, maybe a google search for 'download lmutil.exe' yields a good download page:

FLEXnet License Manager | Plexim 

Also, here's a reference to 

Using the FLEXnet Command Line Utilities (lmutil.exe)

Using the FLEXnet Command Line Utilities (lmutil.exe) :: License Management (Installation Guide for ... 

0 Kudos