Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] Distributed License Servers #2

Open
jneilliii opened this issue Nov 14, 2019 · 2 comments
Open

[QUESTION] Distributed License Servers #2

jneilliii opened this issue Nov 14, 2019 · 2 comments

Comments

@jneilliii
Copy link

First and foremost, thanks for this great tool. It has gone a long way in replacing our old perl based solution. The one question I had was related to distributed license servers. If the license pool is split between multiple servers (in my case 6), is there a way to poll all servers, or craft a license file for input that would allow for pulling the usage of all servers. Running the tool now, it seems that only a couple of the servers are responding to the lmutil lmstat -f command rather than all of them, but if I use the -c switch and include the path to a locally stored lic file that is used on one of the servers that isn't responding the status is returned. Any guidance you could provide would be greatly appreciated.

@jneilliii
Copy link
Author

I think I was able to accomplish what I needed by using the following changes to the code. Please let me know if you see that this will cause an issue or not, it seems to be working.

def get_lmstatus(configs):
    # grab lmutil license manager status output
    # lic_file = configs['licfile']
    lic_files = configs['licfile'].split('|')
    return_result = ''
    for lic_file in lic_files:
        if op.exists(lic_file):
            command = 'lmutil lmstat -c "{}" -a -i'.format(lic_file)
            print(command)
        else:
            command = 'lmutil lmstat -a -i'
        result = subprocess.run(command, stdout=subprocess.PIPE)
        return_result = return_result + result.stdout.decode('utf-8')
    return return_result

Then in the config file I separate all the paths with a | symbol to split on in the licfile variable.

@eirannejad
Copy link
Member

eirannejad commented Nov 14, 2019

@jneilliii You are most welcome. I'd suggest using ; as the path separator since this is the default separator in Windows. And yeah feel free to adjust the code to grab stats from multiple servers and send a PR back for the changes.

Let me know if I can help as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants