We use Flexnet/FlexLM for floating license management.
Get the number of seats in use now:
To find out how many floating license seats are in use at a given point of time, you should run the command
lmutil lmstat -a
on the server. Note that the license server log is not intended to be used for usage reporting, and this is stated in the log header text.
Get the maximum number seats in use over a period of time:
The lmstat command only gives the usage that moment in time. What can be useful to know is the maximum number seats that were checked out during a given time period - for example during an overnight build. The lmstat command does not give this information, but there ways in which it can be estimated.
1) lmstat
By writing an appropriate script, you can run the lmutil lmstat -a command on a regular basis and then analyse the output using a text parser, so that the number of users of a particular FEATURE or INCREMENT line over a period of time can be determined. You will need to decide how frequently you take a license usage snapshot and balance that against how much CPU time is needed to collect those data.
2) Log file
The license server logs all license check-outs and check-ins. The log file name is specified when starting the license server (lmgrd -c <license file> -l <log file>). Here is an example extract:
...
(numinno) IN: "compiler" user@client
(numinno) OUT: "compiler" user@client
(numinno) OUT: "armlink" user@client
(numinno) IN: "compiler" user@client
(numinno) OUT: "compiler" user@client
(numinno) IN: "compiler" user@client
(numinno) OUT: "compiler" user@client
(numinno) IN: "compiler" user@client
(numinno) OUT: "compiler" user@client
...
This log can be parsed by a script to calculate the maximum number of checked-out seats for a given feature/increment. Below is an example available to download below:
Note: This approach does have a number of limitations. In particular it relies on you having the complete server log, as the script relies on counting all the check-outs and check-ins to get an accurate result.
If you want to analyse seat usage for a particular time period it helps to have a log file that only covers that period. This could be done by re-starting the server, but this is not always possible/convenient. The alternative is to use the lmswitch command to start a new log file. Please refer to the FLEXnet End User Guide for information on the use of this command.
Third Party Solutions:
There are several Flexnet License usage software tools out there, and here's a few:
JTB FlexReport LT (Freeware):
https://jtbworld.com/jtb_flexreport/jtbflexreportlt.htm
OPENLM (Freeware):
X-Formation's License Statistics:
https://docs.x-formation.com/pages/viewpage.action?pageId=34668623