LMTOOLS licensing manager. Listing licenses for Autodesk product users

Good afternoon, dear readers.



I will be extremely brief and break the article into paragraphs.



Organizational issues



The number of users of the AutoCAD software product exceeds the number of local network licenses.



  1. The number of specialists working in AutoCAD software is not standardized by any internal document.
  2. Based on paragraph 1, it is almost impossible to refuse to install the program.
  3. Improper organization of work leads to a lack of licenses, which leads to applications and calls to subscribers to the information technology service with this problem.


Technical problems



  1. Lack of funds to view the list of occupied licenses.


Solution options





  1. A turnkey solution supported by the software manufacturer, allowing users to independently view the list of occupied licenses.
  2. Development of any suitable solution for displaying a report of the work of the licensing manager in the form of a web page.


Decision made and implementation



Technical task



  1. The opportunity to save on OS licenses
  2. Listing users holding licenses


Implementing the work of the licensing manager



It was decided to independently implement the necessary function. Order of execution:



  1. Install and configure CentOS 7 on a virtualization server
  2. Install and run Autodesk Network License Manager for Linux
  3. Setting auto start utility when restarting the OS
  4. Setting up the parameter file (I will write about it below)
  5. Installing a local web server and PHP


Implementing a list of occupied licenses



  1. Creating a .sh file with the contents below:



    #! /bin/bash /opt/flexnetserver/lmutil lmstat -a -c [   .lic]> "/var/www/html/log.txt"
          
          





    It is located in a convenient directory, and is configured as an executable file.



    Using this command, the status of the licensing manager is uploaded to the log.txt file

  2. Used command



     watch -n 5 [    №1  .sh]
          
          





    This allows you to call a previously created bash script every 5 seconds.

  3. In the directory log.txt from item No. 1, the index.php file is placed with the following contents



     <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="/jq.js"></script> <title>License server AutoCAD</title> <style> </style> </head> <body> <h1>    autoCAD</h1> <div style="margin: 10px;"> <?php $log = file_get_contents('./log.txt'); $logrp = nl2br($log); $arraystr = explode(PHP_EOL,$logrp); $busy = explode(" ",$arraystr[13]); echo "   : ".$busy[12]." <br/><br/>"; $i = 18; while($i<=37){ //var $a = $i-17; $data = explode(" ", $arraystr[$i]); $time = str_replace('<br', '', $data[13]); //varEND echo "<span>".$a."</span> "; echo "<span>".$data[4]."</span> "; echo "<span>".$data[12]."</span> "; echo "<span>".$data[11]."</span> "; echo "<span>".$time."</span>"; echo "<br>"; $i++; } ?> </div> </body> </html>
          
          





    I ask you not to blame PHP for the code, more professional specialists will do better, and I have done to the best of my knowledge.



    The essence of index.php:



    1. I get the text of the log.txt file, formed earlier by the script, and updated every 5s.
    2. I replace the transfer tags with html tags.
    3. I break the text into an array line by line.
    4. I format the order and contents of the lines.


The result of the implementation of all requirements



What the server GUI looks like:



image



What a webpage looks like:



image



.Opt Options File



Indicated in it



TIMEOUTALL 14400



- program downtime is limited to 4 hours

MAX_BORROW_HOURS [CODE] 48



- The maximum borrowing period is limited to 2 days.



Add. information



Because the organization uses the correct registered domain account. records of employees, by login it is very easy to identify the specialist who has taken the license.



The total result of the efforts:



  1. The user independently sees the occupied license and, accordingly, the load of the technical support service is reduced.
  2. Inside the team of specialists working in software without the participation of those. For support, the question “Who will get the license?” is resolved, and depending on the priority of the work, the license is released or dealt with.
  3. Save on Windows licensing.



All Articles