6 Replies Latest reply on Jul 5, 2016 12:46 PM by Bill Robinson

    using multiple profiles from Linux NSH issue

    Bogdan Dumitrescu



      I am having the follwing issue.


      in my infrastructure, i need to connect to 3 or more environments to fetch data from BladeLogic.


      I need Server Properties values outside BladeLogic.


      My working environment is a RHEL 6 server, console 8.6 and multiple 8.6 isolated Bladelogic environments .


      I have developed an NSH script which is able to connect to all the environments and fetch the data.


      The problem:


      Because the environments have more than 10.000 servers each, i need to import this data for daily usage. This can take up to 4-6 Hours so i cannot do this sequentially. Because of this, i tried the following approaches:

      1. i have created a function to get this data from each environment and created a for loop to start multiple imports (one for each environment, by sending them to background). I have included all the blcli performance commands and JVM settings into the function in order to avoid losing the credentials when a subshell is started and a new JVM is used)

      2. I tried to perform this action without using functions, in order to avoid losing the credentials because of the subshell/VM mechanism.

      After running this using multiple methods, i had the same issue: the last credentials that were cached using blcred cred -acquire -i keytab_file -profile Profile were the ones which succeeded. I have tried to print the cached credentials before running blcli_connect  and this was the result. All the time, only the last cached credentials were displayed.


      The only workaround i have found was to use sleep 10s for each loop in order to permit the blcli_connect function to use the last acquired credentials. This way, the connection was successful and i had managed to import the data from all the environments.  My last check was to start this script from multiple ssh consoles/sessions and then the problem reappeared.


      a) What happens with the stored credentials in a NSH subshell after the connection? Are they stored until the subshell is closed? Are they protected from the credential acquire process from other subshells/shell instances?


      b) Could anyone explain to my how the credentials are cached? I have read another post from Bill Robinson and i understand that  only one Profile is stored for each system user at a specific moment. Is this correct? If it is like this, how can i start multiple NSH scripts (more than 10 at the same time) to trigger actions on different application servers in a safe way?


      For the Windows console, there are multiple application profiles which are used so you can start multiple instances of the GUI against multiple Application Servers without issues.


      My system is accesibile from only one environment so there is no elegant way to trigger the action from Bladelogic and push the results to the target system.


      Thank you.