cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

License Monitoring Miscount for reserved licenses

davehaigh
12-Amethyst

License Monitoring Miscount for reserved licenses

I've downloaded PTC's license monitoring script and am trying to get it functioning.

So far I've noticed something odd. For licenses were I'm reserving some for a group of individuals, the script is reporting one more used than is shown used when you type ptcstatus.

The licenses monitoring download
4 REPLIES 4

David,



The core of that script is based on this:



lmutil.exe lmstat -c <path_to_license_file> -f feature



So for example in my case one feature looks like this...



D:\web\home\lmutil.exe lmstat -c
D:\web\home\flexLicenses\ptc_license.dat -f PROE_FoundationAdv



The script was written by Mr. Fischer quite a few years ago and the
output of the lmutil command has since changed. To get the number of
licenses in use he simply counted the number of times the command above
generated a line which contained the string "7788@<server_name>". The
output of the lmutil command now contains a line which reads:



License server status: 7788@<server>



Which causes the "licenses in use" counter to increase by 1. To correct
this to make it work for the new lmutil command you need to modify line
#105 in his get_lice_count.pl file. Currently it reads:



if ($line =~ /$string/)



It should now be updated to read:



if ($line =~ /$string/ && $line !~ m/License
server status/)



Which basically says "count all lines containing "7788@<server>" unless
that line also contains the string "License server status".



HTH,

Steve


Steve,
Thanks for pointing me down the right path.

However I did find that when you reserve licenses for a group of people it puts an extra line in the output that throws the count off. I had to modify line 105 like this to get it to work for me:
if ($line =~ /$string/ && $line !~ m/RESERVATION/)

If you look at the output of the command his script is running I get this which has some issues.

"C:\Ptc\flexlm\bin\lmutil" lmstat -c "C:\Inetpub\wwwroot\ptcstat\ptc_license.dat" -f PROE_Flex3C
lmutil - Copyright (c) 1989-2006 Macrovision Europe Ltd. and/or Macrovision Corporation. All Rights Reserved.
Flexible License Manager status on Tue 4/19/2011 09:38

[Detecting lmgrd processes...]
Users of PROE_Flex3C: (Total of 13 licenses issued; Total of 13 licenses in use)

"PROE_Flex3C" v31.0, vendor: ptc_d
floating license

***** (v29.0) (*****/7788 1326), start Tue 4/19 9:16
8 RESERVATIONs for GROUP designers (*****/7788)
***** (v29.0) (*****/7788 315), start Tue 4/19 7:14
***** (v29.0) (*****/7788 218), start Tue 4/19 8:20
***** (v29.0) (*****/7788 615), start Tue 4/19 8:47
***** (v29.0) (*****/7788 727), start Tue 4/19 8:42

There are a couple of errors here. It's saying 13 licenses are in use and his script is counting the Reservations line. The 8 number shows how many licenses are still reserved or in otherwords free. 13-8 equals the 5 licenses that are in use.

If we look at a license were I don't reserver licenses for a group the output looks like this and his script counts the number in use properly.
"C:\Ptc\flexlm\bin\lmutil" lmstat -c "C:\Inetpub\wwwroot\ptcstat\ptc_license.dat" -f MATHCAD
lmutil - Copyright (c) 1989-2006 Macrovision Europe Ltd. and/or Macrovision Corporation. All Rights Reserved.
Flexible License Manager status on Tue 4/19/2011 09:45

[Detecting lmgrd processes...]
Users of MATHCAD: (Total of 16 licenses issued; Total of 4 licenses in use)

"MATHCAD" v20.0, vendor: ptc_d
floating license

***** (v14.1) (*****/7788 1007), start Mon 4/18 11:32
***** (v14.1) (*****/7788 930), start Mon 4/18 16:49
***** (v14.0) (*****/7788 101), start Wed 4/13 20:58
***** (v14.0) (*****/7788 1424), start Tue 4/19 8:25

Seems there should be a better way to grab the licenses. Not sure why he didn't just grab the values from ptcstatus. That's what I did back when I was running SGI's.

David Haigh
proed
7-Bedrock
(To:davehaigh)

Hi guys



For monitoring Pro/E or any other Flex licenses you could also try CADminTools. I've retired the main website, but it's still available online:
http://www.cadmin.pwp.blueyonder.co.uk/CADminTools/


I've not updated the public code for a few years, but it's still getting used by hundreds of companies all round the world to monitor thousands of licenses...


Have fun!


Edwin Muirhead



In Reply to David Haigh:


Steve,
Thanks for pointing me down the right path.

However I did find that when you reserve licenses for a group of people it puts an extra line in the output that throws the count off. I had to modify line 105 like this to get it to work for me:
if ($line =~ /$string/ && $line !~ m/RESERVATION/)

If you look at the output of the command his script is running I get this which has some issues.

"C:\Ptc\flexlm\bin\lmutil" lmstat -c "C:\Inetpub\wwwroot\ptcstat\ptc_license.dat" -f PROE_Flex3C
lmutil - Copyright (c) 1989-2006 Macrovision Europe Ltd. and/or Macrovision Corporation. All Rights Reserved.
Flexible License Manager status on Tue 4/19/2011 09:38

[Detecting lmgrd processes...]
Users of PROE_Flex3C: (Total of 13 licenses issued; Total of 13 licenses in use)

"PROE_Flex3C" v31.0, vendor: ptc_d
floating license

***** (v29.0) (*****/7788 1326), start Tue 4/19 9:16
8 RESERVATIONs for GROUP designers (*****/7788)
***** (v29.0) (*****/7788 315), start Tue 4/19 7:14
***** (v29.0) (*****/7788 218), start Tue 4/19 8:20
***** (v29.0) (*****/7788 615), start Tue 4/19 8:47
***** (v29.0) (*****/7788 727), start Tue 4/19 8:42

There are a couple of errors here. It's saying 13 licenses are in use and his script is counting the Reservations line. The 8 number shows how many licenses are still reserved or in otherwords free. 13-8 equals the 5 licenses that are in use.

If we look at a license were I don't reserver licenses for a group the output looks like this and his script counts the number in use properly.
"C:\Ptc\flexlm\bin\lmutil" lmstat -c "C:\Inetpub\wwwroot\ptcstat\ptc_license.dat" -f MATHCAD
lmutil - Copyright (c) 1989-2006 Macrovision Europe Ltd. and/or Macrovision Corporation. All Rights Reserved.
Flexible License Manager status on Tue 4/19/2011 09:45

[Detecting lmgrd processes...]
Users of MATHCAD: (Total of 16 licenses issued; Total of 4 licenses in use)

"MATHCAD" v20.0, vendor: ptc_d
floating license

***** (v14.1) (*****/7788 1007), start Mon 4/18 11:32
***** (v14.1) (*****/7788 930), start Mon 4/18 16:49
***** (v14.0) (*****/7788 101), start Wed 4/13 20:58
***** (v14.0) (*****/7788 1424), start Tue 4/19 8:25

Seems there should be a better way to grab the licenses. Not sure why he didn't just grab the values from ptcstatus. That's what I did back when I was running SGI's.

David Haigh
mmeadows-2
5-Regular Member
(To:proed)

Announcements
NEW Creo+ Topics: PTC Control Center and Creo+ Portal


Top Tags