LMTOOLS Licensing Manager. Listing licenses for users of Autodesk products

Good day, dear readers.

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

Organizational problems

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 point number 1, it is almost impossible to refuse to install the program.
  3. Incorrect organization of work leads to a shortage of licenses, which leads to applications and calls from subscribers to the information technology service with this problem.

Technical problems

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

Solutions

  1. A turnkey solution supported by the software manufacturer that allows users to independently view the list of occupied licenses.
  2. Development of any suitable solution for displaying a report on the operation of the license manager in the form of a web page.

Accepted decision and implementation

Technical task

  1. Opportunity to save on OS licenses
  2. Displaying a list of users occupying licenses

Implementing the Licensing Manager

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

  1. Installing and configuring CentOS 7 on a virtualization server
  2. Installing and running the Autodesk Network License Manager for Linux
  3. Setting the utility to start automatically on OS restart
  4. Configuring the parameter file (I will write about it below)
  5. Installing a local web server and PHP

Implementation of displaying the list of occupied licenses

  1. Create a .sh file with the following content:
    	#! /bin/bash
    	/opt/flexnetserver/lmutil lmstat -a -c [ΠΏΡƒΡ‚ΡŒ ΠΊ Ρ„Π°ΠΉΠ»Ρƒ .lic]> "/var/www/html/log.txt"
    	

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

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

  2. Used the command
    watch -n 5 [ΠΏΡƒΡ‚ΡŒ ΠΊ созданному Π² ΠΏβ„–1 Ρ„Π°ΠΉΠ»Ρƒ .sh]

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

  3. In the log.txt directory from step #1, there is an index.php file with the following content
    <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>
    	

    Please do not judge the PHP code, more professional specialists will do it better, and I did it to the best of my knowledge.

    How index.php works:

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

The result of the implementation of all requirements

What the server GUI looks like:

LMTOOLS Licensing Manager. Listing licenses for users of Autodesk products

What the web page looks like:

LMTOOLS Licensing Manager. Listing licenses for users of Autodesk products

.opt Options File

It indicated

TIMEOUTALL 14400 - program downtime is limited to 4 hours
MAX_BORROW_HOURS [CODE] 48 β€” The maximum borrowing period is limited to 2 days.

Extras. information

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

The overall result of the effort:

  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. support, the question β€œWho will get the license?” is resolved, and depending on the priority of the work, the license is released or occupied.
  3. Savings on Windows licensing.

Source: habr.com

Add a comment