- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
12-17-2021 08:26 AM
hi ,
I'm trying to create a Python script that I can run from management
to change the Installation Package value,
something like this;
import os
os.system('/opt/traps/bin/cytool reconnect force ecXXXXXXXXXXXX5efdbe920')
I was already able to create one like this for my Windows machines, and there it was more complex because I had to assemble the password by 'echo' in the right position, but it works.
In Linux machines it does not work even though I do not even have to pass a password because I am running through the system
Any idea is welcome, thanks in advance
12-20-2021 12:24 AM
Dear @chaim_Avisrur
You have two option as you know. You can write your own python script or "execute_commands" script.
for both of them, You may need to import traps lib path in to environment variables. Could you try like below?
export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/local/lib64:/usr/lib64:/opt/traps/glibc/lib/x86_64-linux-gnu/ && /opt/traps/bin/cytool ....
Emre
12-20-2021 12:24 AM
Dear @chaim_Avisrur
You have two option as you know. You can write your own python script or "execute_commands" script.
for both of them, You may need to import traps lib path in to environment variables. Could you try like below?
export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/local/lib64:/usr/lib64:/opt/traps/glibc/lib/x86_64-linux-gnu/ && /opt/traps/bin/cytool ....
Emre
12-21-2021 04:03 AM
@chaim_Avisrur If you prefer not to change the LD_LIBRARY_PATH, you can consider changing the working directory using
os.chdir('/opt/traps/bin') before executing cytool. That should pick up the libraries from the relative paths.
12-21-2021 04:30 AM
hi @bbarmanroy ,
i tried it before(it didnt work) and also did some research ,
if the change of LD_LIBRARY_PATH if excuted within the script it is not permanent on the machine only while the script is running.
i did some tests and there is no change on that varible after the run.
thanks
12-21-2021 05:38 PM
@chaim_Avisrur You're right. The library paths need to be set before the script is executed. If you can run a shell script from your management tool, you can set the library path in the script and execute "/opt/traps/bin/cytool reconnect force <password>". This way, your global library path won't be altered, and the script should still execute successfully within the temporary environment of the session.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!