6 Replies Latest reply on Jun 23, 2015 1:02 PM by Mike Reider

    NSH authentication failure - but script still runs on hosts

    Mike Reider

      BSA 8.5.1 260

       

      we are running a NSH script that does a simple remote execution of a command based on provided Server Group and Command

       

      when running the script, I provided an incorrect login name so auth to app server will fail, but weirdly it still continues through and runs the command on each server,


      Here Im passing a bad password so auth will fail, but it continues w the execution. Im guessing my auth profile and login is cached and stays cached even if my next login is incorrect.

       

      ./remote_exec.nsh -username mreider -profile prod3 -servergroup "/Workspace/testLinux" -cmd "whoami"

      password:********

      Authentication failure: SRP Authentication Failure

      ==== Executing command 'whoami' against: ulvzndat21

      root

      ==== Executing command 'whoami' against: guedlpacar002

      root

       

      heres the NSH script,

       

      #!/bin/nsh

      blcli_setjvmoption -Dcom.bladelogic.cli.execute.quietmode.enabled=true

      blcli_setjvmoption -Dcom.bladelogic.cli.execute.addnewline.enabled=true

      blcli_setjvmoption -Xmx1024m

       

      blcred cred -acquire -profile ${PROFILE} -username ${USERNAME}

      blcli_setoption serviceProfileName ${PROFILE}

      blcli_setoption roleName BLAdmins

      blcli_connect


      blcli_execute Server listServersInGroup "${GROUP}"

      blcli_storeenv SERVER_LIST


      for eachServer in $SERVER_LIST

      do

           echo "==== Executing command '${CMD}' against: $eachServer"

           nexec $eachServer "${CMD}"

           sleep 1

      done

       

      # DISCONNECTING THE SESSION

      blcli_disconnect