A colleague of mine recently asked me if he could track our division's Matlab (floating) license usage, including the various Toolboxes. I couldn't find anything online, so I wrote my own. Matlab uses the FLEXnet license manager, which provides command line utilities to perform basic operations.
By making calls to the lmstat utility within lmutil, it's possible to get a current list of users, for example:
/usr/local/MATLAB/R2011b/etc/glnx86/lmutil lmstat -c /usr/local/MATLAB/R2011b/licenses/network.lic -a
In order to exploit this, I wrote a Python module which can be used to query the lmstat server, insert the data into a database, analyse the data and export to TSV file(s). For verification purposes, it can slao create a dummy database and list or plot the aggregated daily profile. The command-line function can be called at regular intervals, via cron or the like, to update the data periodically.
The second step was to create a nice visualisation of the data. I wanted a dynamic web-based utility for easy, up-to-date access. D3.js is perfect for this. I merged two examples from Mike Bostock and added a few nice features like transitions and tooltips.
Here is the final result...
The full code is here.