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 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".
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)
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)
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.
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)
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)
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.