Does anyone have any experience querying FlexLM? (At a minimum) I need to be able to tell if a license is available for a particular application. Previously this was done by checking what processes were running, but if I can somehow query FlexLM, that would be more elegant!
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
I've done this recently. I needed to query FlexLM license servers, and discover what licenses were outstanding/available. I didn't find a reasonable API for this, so I instead just launched lmutil, asked it to query the server, and parsed laboriously through the textual results. A pain, but it worked, and really didn't take that long to put together.
Find your copy of lmutil.exe, and run it with either the -a or -i switch, depending on the data you want to gather. Pass it the server and port you wish you query, with the -c switch. Yes, you will need to know the port the FlexLM daemon's running on. There's a standard port, but there's nothing forcing it to run on that port only.
Since I needed to run this regularly, and I needed to query thousands of daemons, I drove lmutil from an application - something like:
...then you need to parse through the results. Depending what you're looking for, this could be as simple as splitting the result lines over space characters.