Is there a way to track concurrent license usage and lockouts?

13909
23
02-04-2016 09:45 AM
JacquelinePursell
Occasional Contributor

I want to increase the number of licenses we have but in order to justify it to the budget committee I need to prove that people are getting locked out often and that we are at max capacity often.  Is there a way to track this?

23 Replies
XanderBakker
Esri Esteemed Contributor

If you look at the line that holds the information of the DENIED license:

13:50:40 (ARCGIS) DENIED: "ARC/INFO" xbakker@LOLIVARE1  (Licensed number of users already reached. (-4,342))

... you will see that the line does not contain the date (only the time). You should probably scan the log file and register the reference to the date on previous lines and include the last date as the date of the DENIED license. I know I have done that before. I will have a look if I can find it and post it.

The list that I produce in the script includes a count for each denial of a license vs user@computer. You seem to want the data without aggregation, which is easier. On lines 12 to 16 don't add it to the dictionary, but parse and print it.

We switched to a different method a poll the license server every 15 - 20 minutes and extract the statistics based on that.

RebeccaStrauch__GISP
MVP Emeritus

Thanks Xander. 

We've been tracking out stats by parsing and storing in a SQL database, then running some excel scripts once a year to get info once a year to determine our usage per users, Division, etc.  It summarizes "hours" etc.  It's a bit cumbersome to deal with, and I'm relying on another staff person to have time to give me the spreadsheet, but it does provide a  lot of info.  But I think I'll look more into doing something similar to what you have so I can get the data in a little easier manner.  Thanks again for the script.

V_StuartFoote
MVP Frequent Contributor

We switched to a different method a poll the license server every 15 - 20 minutes and extract the statistics based on that.

Yes, that is the other way to go, polling the server is done with a current FlexNet Publisher ** "lmutil.exe lmstat -a -c" across the network. Limitation with this is you will only track successful feature checkouts. So no indications when denials for specific features occur.

Julie Skuba's WHATLG .NET based GUI utility uses this approach.

** Bundled with the license manager on install--copy to the client running the script.

0 Kudos
XanderBakker
Esri Esteemed Contributor

You could do something like this:

def main():
    log_file = r'D:\Xander\EPM\Licencias\LMgrd\LOLIVARE1_10.3.LOG'
    with open (log_file, "r") as inp:
        lines=inp.readlines()

    last_date = ''
    print "date\ttime\tfeature\tuser\tcomputer"
    for l in lines:
        if '(ARCGIS) (@ARCGIS-SLOG@) Time: ' in l:
            # 22:58:05 (ARCGIS) (@ARCGIS-SLOG@) Time: Fri Dec 19 2014 22:58:05 Hora est. Pacifico, Sudamerica
            lst = l.split('(ARCGIS) (@ARCGIS-SLOG@) Time: ')
            last_date = lst[1][:15]

        if 'DENIED' in l:
            # 13:50:40 (ARCGIS) DENIED: "ARC/INFO" xbakker@LOLIVARE1  (Licensed number of users already reached. (-4,342))
            l = l.strip()
            lst = l.split(' ')
            time = lst[0]
            feature = lst[3]
            usercomp = lst[4]
            lst = usercomp.split('@')
            user = lst[0]
            comp = lst[1]
            print '{0}\t{1}\t{2}\t{3}\t{4}'.format(last_date, time, feature, user, comp)

if __name__ == '__main__':
    main()

Which will yield in my case, this:

datetimefeatureusercomputer
Thu Jan 08 201513:50:40"ARC/INFO"xbakkerLOLIVARE1
Thu Jan 08 201513:50:40"ARC/INFO"xbakkerLOLIVARE1
Thu Jan 08 201513:50:54"ARC/INFO"xbakkerLOLIVARE1
Thu Jan 08 201513:50:54"ARC/INFO"xbakkerLOLIVARE1
Thu Jan 08 201513:51:01"ARC/INFO"xbakkerLOLIVARE1
Thu Jan 08 201513:51:01"ARC/INFO"xbakkerLOLIVARE1
Fri Jan 16 20157:48:42"Editor"dduquejDDUQUEJ2
Fri Jan 16 20157:56:24"Editor"dduquejDDUQUEJ2

Which also reveals duplicate records and I'm sure there will be numerous situations where this script will gloriously fail...

This is why we poll the license server to extract the data we want.

XanderBakker
Esri Esteemed Contributor

I just stumbled over this GitHub project: GitHub - jmitz/ArcGISLicenseMonitor: Aids in monitoring licenses managed by ESRI's ArcGIS License Ma...  May be worth to look at....

DaveTenney
Occasional Contributor III

i find this solution very interesting!

does the db and script need to live on the same machine that the License Manager lives? we have our LM on a standalone machine that is on our network. has anyone successfully implemented this approach?

Dave

0 Kudos
ChelseaRozek
MVP Regular Contributor

I just implemented it and am super excited to watch the data come in. I made a graph in Power Bi to watch the number of users each hour vs. each licenses' max allowance. I'm not 100% sure if it HAS to live on the same machine, ours just worked out that way because our LM and scheduled scripts are on the same machine. I think it needs license manager files to reference on its own machine but can then also access others by IP address, but I could be wrong.

0 Kudos
DaveTenney
Occasional Contributor III

Maybe you can help me with something, first here is my setup:

local machine:

   localhost/sqlexpress (license tracking db was created here)

machine on local server

   ArcGIS LM

i think im running into issues with the following section:

   cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=ServerNameOrIP;DATABASE=DatabaseName;UID=UserId;PWD=Password')

im not sure if i've set this part up correctly, could you share some insight on this particular section?

thanks

dave

0 Kudos
ChelseaRozek
MVP Regular Contributor

yes! that part was tricky for me. hope this can help:

- the code was written a while ago, so I had to update the DRIVER part to what's below for me

- we made a super complicated password, but it kept tripping up on ' " ; characters because I couldn't figure out how to escape all of them, try just alphanumeric characters to eliminate that as a potential issue

 

cnxn = pyodbc.connect("DRIVER={ODBC Driver 17 for SQL Server};SERVER=servername.ewashtenaw.org;DATABASE=databasename;UID=username;PWD=password;")

 

also, I ended up passing the ip address of the machine the LM and script are on into the script when run, not 'localhost' or blank. i thought maybe you only needed ip addresses if you were looking at LMs elsewhere too, but this is what's working for me so I'll keep it.

fyi my database is on another server than the LM/scripts

0 Kudos
DaveTenney
Occasional Contributor III

first...thank you for all your help!

  this may be a silly question, but does the odbc driver need to be installed on the machine that is running the script and LM in order to connect back to the machine running SQL?

thanks again

0 Kudos