All Projects → tvapdx → FlexLM-License-Usage-Logger

tvapdx / FlexLM-License-Usage-Logger

Licence: MIT license
python utility script to parse and log the lmutil lmstat results on a FlexLM server

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to FlexLM-License-Usage-Logger

RevitExportObjAndGltf
The Revit-based plug-in realizes the export of 3D files in obj or gltf format, which may have small material problems, which can be improved in the later stage; because the project needs to engage in the secondary development of Revit in the near future, similar plug-ins are rarely found on the Internet Related information will be recommended to…
Stars: ✭ 42 (+110%)
Mutual labels:  revit
FreeMVD WorkFlow
This project has been moved/forked to https://gitlab.com/osarch/FreeMVD_WorkFlow
Stars: ✭ 21 (+5%)
Mutual labels:  revit
RevitTemplates
Templates for creating plugins for Revit
Stars: ✭ 64 (+220%)
Mutual labels:  revit
SpeckleRevitReboot
Check a brand new Speckle at: https://github.com/specklesystems
Stars: ✭ 25 (+25%)
Mutual labels:  revit
Nina
A collection of Shorcuts to work faster in Revit.
Stars: ✭ 17 (-15%)
Mutual labels:  revit
thesaurus
TT Hackathon 2018 - Autocomplete for Visual Programming Nodes
Stars: ✭ 23 (+15%)
Mutual labels:  revit
DynAI
Practical applications of AI / Machine Learning in BIM, implemented as a Dynamo Package
Stars: ✭ 24 (+20%)
Mutual labels:  revit
revit-family-web-viewer
Revit Web Viewer is a Three.js-based project viewer. Revit projects / families must be exported using RvtVa3cExporter (https://github.com/va3c/RvtVa3c)
Stars: ✭ 48 (+140%)
Mutual labels:  revit
GeniusLociForDynamo
Genius Loci is a package of 300+ custom nodes for Dynamo in Revit.
Stars: ✭ 17 (-15%)
Mutual labels:  revit
mapboxRevit
View Revit models inside Mapbox
Stars: ✭ 23 (+15%)
Mutual labels:  revit
SpeckleRevit
Archived, dev moved to https://github.com/speckleworks/SpeckleRevitReboot
Stars: ✭ 17 (-15%)
Mutual labels:  revit
RevitFamilyBrowser
Browser for .rfa Revit family files
Stars: ✭ 82 (+310%)
Mutual labels:  revit
Onboxframework
A framework for building Cross-Platform Revit Apps
Stars: ✭ 41 (+105%)
Mutual labels:  revit
speckle-sharp
.NET SDK, Schema and Connectors: Revit, Rhino, Grasshopper, Dynamo, ETABS, AutoCAD, Civil3D & more.
Stars: ✭ 214 (+970%)
Mutual labels:  revit
Revit2glTF
An open source glTF format exporter for Autodesk Revit.
Stars: ✭ 143 (+615%)
Mutual labels:  revit
OrchidForDynamo
This repository contains the content of the Orchid package for Dynamo
Stars: ✭ 81 (+305%)
Mutual labels:  revit
RevitExtensions
Extensions for Revit plugin development
Stars: ✭ 37 (+85%)
Mutual labels:  revit

FlexLM License Usage Logger

python utility script to parse the lmutil lmstat results on a FlexLM server and log the license usage for each product and active users. Clone this repo on license server machine and create a cron job to call this method at intervals.

Config

The script expects minimum configuration below, at config file: %PROGRAMDATA%/FlexLMLicenseUsageLoggerConfig.ini

[DEFAULT]
logusers = True or False
logpath = \\shareddrive\flexlm\Logs
licfile = C:\Autodesk\Network License Manager\LicenseFile.lic
usedb = True or False
dbms = postgres
dbhost = 192.168.000.000
dbport = 5432
dbuser = username
dbpass = password
dbname = database name
# see below for table creation SQL
# revise the table names as necessary
dbflexfeaturestable = flexlmfeatures or anything else
dbflexfeaturecodestable = flexlmfeaturecodes or anything else
dbflexuserstable = flexlmusers or anything else

Logging to a Database

Logs could be pushed to a database server. This script uses the records python module to talk to the database server and builds a connection string based on the configurations provided in the config file. To log to a database, provide the database info in the config file and also set usedb = True

Feature logs

Feature logs are written to the database and table specified in the config file.

Table Schema
-- modify table name as needed
CREATE TABLE flexlmfeatures (
    dtime timestamp,
    fcode varchar(255),
    fver varchar(255),
    vendor varchar(255),
    lictype varchar(255),
    issued integer,
    used integer,
    ausers integer
);

Example Entry:

2018-09-05 16:32:15,67647324PRM_2018_0F,1.000,--,--,125,12,11

User logs

User logs are written to the database and table specified in the config file.

Table Schema
-- modify table name as needed
CREATE TABLE flexlmusers (
    fcode varchar(255),
    userid varchar(255),
    host varchar(255),
    display varchar(255),
    fver varchar(255),
    shost varchar(255),
    sport integer,
    lichandle integer,
    ctime timestamp,
    utime timestamp
);

Example Entry:

67647324PRM_2018_0F,ehsan.irannejad,ein1,ein1,1.0,flexlmserver,8888,121,2018-09-05 10:41:00,2018-09-05 16:32:15

Logging to a Directory

Log could be saved as CSV files. By default one csv file will be created for each day of logging. To log to a directory, provide the path in the config file and also set usedb = False

In current implementation, there are two types of logs for each day:

Feature logs

There is a single feature log file for each day. Feature log files are good for tracking the overall license usage.

Filename format: YYYY-MM-DD features.csv

Example: e.g. 2018-09-05 features.csv

Schema
stamp,feature_code,feature_version,vendor,license_type,issued,used,users

Example Entry:

2018-09-05 16:32:15,67647324PRM_2018_0F,1.000,--,--,125,12,12

User logs

There is one user log file per each license feature. User logs are good for tracking license usage by specific users.

Filename format: YYYY-MM-DD <feature_code> users.csv

Example: e.g. 2018-09-05 67647324PRM_2018_0F users.csv

Schema
feature_code,userid,host,display,feature_version,server_host,server_port,license_handle,checkout_datetime,update_time

Example Entry:

67647324PRM_2018_0F,ehsan.irannejad,ein1,ein1,1.0,flexlmserver,8888,121,2018-09-05 10:41:00,2018-09-05 16:32:15

Feature Code Lookups

A set of CSV files are inside Feature Codes directory. They have been gathered from ADN Feature Codes

These tables can be used to lookup product names from feature codes.

You can use the pushfc option on the logging script to automatically push the feature codes csv file included in Feature Codes directory to your database.

$ pipenv shell
$ python logLicenseUsage.py pushfc
Table Schema

fcodes is a ; separateed list of possible feature codes for each product.

-- modify table name as needed
CREATE TABLE flexlmfeaturecodes (
    fname varchar(255),
    fcodes text
);

Example Entry:

Autodesk Navisworks Simulate 2017,86767NAVSIM_2017_0F;85838NAVSIM_F;85838NAVSIM_T_F

Pushing CSV Logs to Database

If you had started logging the license usage to csv log files and then decided to push these logs to your database, you can use the pushf and pushu options. Make sure the database is configured first and connection information is included in the config file.

To push feature log files (*feature.csv):

$ pipenv shell
$ python logLicenseUsage.py pushf /path/to/feature/files/dir

To push user log files (*users.csv):

$ pipenv shell
$ python logLicenseUsage.py pushu /path/to/user/files/dir

Dependencies

  • FlexLM Utility: lmutil.exe is shipped inside the FlexLM installation directory. Make sure to add the path to the %PATH% env var. lmutil can be used from local machines that see the license server as well. You can download and install Autodesk Network License Manager on your machine to use the lmutil utility.
  • python 3.7: Install python on server machine.

Installing python modules

This script uses pipenv for package management. If you don't have pipenv installed, simply:

# use pip3 if you have python 2 and 3 installed
pip install pipenv

Then cd to the repo directory and:

# pipenv will install all python dependencies
pipenv install
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].