Cortex Xdr Cytool Linux Force Reconnect

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cortex Xdr Cytool Linux Force Reconnect

L0 Member

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

 

Cortex XDR 

1 accepted solution

Accepted Solutions

L3 Networker

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

View solution in original post

4 REPLIES 4

L3 Networker

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

L5 Sessionator

@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.

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

L5 Sessionator

@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.

  • 1 accepted solution
  • 5223 Views
  • 4 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!