Good afternoon, dear readers.
I will be extremely brief and will divide the article into points.
Organizational Issues
The number of users of the AutoCAD software exceeds the number of local network licenses.
- The number of specialists working with AutoCAD software is not restricted by any internal document.
- Based on point #1, it is almost impossible to refuse the installation of the program.
- Poor work organization leads to a shortage of licenses, which causes requests and phone calls from subscribers to the IT service regarding this issue.
Technical Issues
- Lack of resources to view the list of occupied licenses.
Solution Options
- A ready-made solution supported by the software manufacturer, allowing users to independently view the list of occupied licenses.
- Developing any suitable solution to display the licensing manager's report as a web page.
Accepted Decision and Implementation
Technical specifications
- The possibility of saving on the OS license
- Displaying the list of users occupying licenses
Implementing the licensing manager's operation
The decision was made to independently implement the necessary function. The procedure is as follows:
- Installing and configuring CentOS 7 on the virtualization server
- Installing and starting Autodesk Network License Manager for Linux
- Configuring the utility to auto-start on OS restart
- Configuring the parameter file (I will write about it below)
- Installing local web server and PHP
Implementing the display of the list of occupied licenses
- Creating a .sh file with the content provided below:
#! /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.
This command retrieves the status of the licensing manager into a log.txt file.
- I used the command
watch -n 5 [path to the created .sh file from point #1]This allows invoking the previously created bash script every 5 seconds.
- In the directory log.txt from point #1, the file index.php is placed 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>List of AutoCAD license server licenses</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 "Currently occupied: ".$busy[12]." licenses<br /><br />"; $i = 18; while($i<=37){ //$a = $i-17; $data = explode(" ", $arraystr[$i]); $time = str_replace('<br', '', $data[13]); //varEND echo "<span>".$a." "; echo "<span>".$data[4]." "; echo "<span>".$data[12]." "; echo "<span>".$data[11]." "; echo "<span>".$time.""; 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.
The essence of index.php:
- I retrieve the text from the log.txt file, formed earlier by the script, and updated every 5 seconds.
- I replace line break tags with HTML tags.
- I split the text into an array by lines.
- I format the order and content of the lines.
The result of implementing all requirements
What the GUI looks like server:

What the web page looks like:

.opt parameter file
It specifies
TIMEOUTALL 14400 — the program downtime is limited to 4 hours
MAX_BORROW_HOURS [CODE] 48 — the maximum borrowing period is limited to 2 days.
Additional information
Since the organization uses correct named domain accounts for employees, it is very easy to identify the specialist who took the license by the login.
Overall result of efforts:
- Users can see the occupied license themselves, which reduces the load on the technical support service.
- Within the team of specialists working in the software without the involvement of technical support, the question of 'Who will get the license?' is resolved, and depending on the priority of tasks, the license is either freed or occupied.
- Savings on Windows licensing.
Source: habr.com
