2 Replies Latest reply on Mar 31, 2015 6:42 AM by Bill Robinson

    ImportExport and no output

    Narahari Lakshminarayana

      Friends:

       

      I am trying to an importexport call but I see no output.  This code is run inside of the BLA console.

       

      Here is the code that I am doing (take my word regarding the DB Key, it is valid)

      #! nsh

      BuildDate=$(date +"%m-%d-%Y")

      echo $BuildDate

       

       

      SCRIPT_SOURCE=$(readlink -f ${0} | sed -e "s:\\\:/:g")

      echo "The following script starts, ${SCRIPT_SOURCE}"

      echo "The script is running on the host $(hostname)"

       

       

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

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

       

       

      echo "About to execue blcli_execute ImportExport exportObject 111 DBKey:SJobModelKeyImpl:5443223-2-89158778 /tmp/DIT003-PAAS004-PAAS2.3.4-deploy_dbd_22768"

      blcli_execute ImportExport exportObject "111" "DBKey:SJobModelKeyImpl:5443223-2-89158778" "/tmp/DIT003-PAAS004-PAAS2.3.4-deploy_dbd_22768"

       

       

      echo "Now let us list the contents of the folder /tmp/DIT003-PAAS004-PAAS2.3.4-deploy_dbd_22768"

      ls -ltr "/tmp/DIT003-PAAS004-PAAS2.3.4-deploy_dbd_22768"

       

       

      exit 0

       

      Here is the output

      Job Name,"extractParamValueForJob - Run at Mar 30, 2015 9:52:48 AM"

      Start Time,Mar 30, 2015 9:52:48 AM

      End Time,Mar 30, 2015 9:53:05 AM

      Status,Completed Successfully

       

       

      Participant,Type,Date,Message

      "Run at Mar 30, 2015 9:52:48 AM",Info,"Mar 30, 2015 9:52:48 AM","Started running the job 'extractParamValueForJob' with priority 'NORMAL' on application server 'JobServer06'(2,013,260)"

      "Run at Mar 30, 2015 9:52:48 AM",Info,"Mar 30, 2015 9:52:51 AM",Executing work item NSH Script Job:extractParamValueForJob; Server:10.25.51.191;  on application server: JobServer07

      10.25.51.191,Info,"Mar 30, 2015 9:52:52 AM",03-30-2015

      10.25.51.191,Info,"Mar 30, 2015 9:52:52 AM","The following script starts,"

      10.25.51.191,Info,"Mar 30, 2015 9:52:52 AM",The script is running on the host nadportdev4

      10.25.51.191,Info,"Mar 30, 2015 9:52:52 AM",About to execue blcli_execute ImportExport exportObject 111 DBKey:SJobModelKeyImpl:5443223-2-89158778 /tmp/DIT003-PAAS004-PAAS2.3.4-deploy_dbd_22768

      10.25.51.191,Info,"Mar 30, 2015 9:53:05 AM",Now let us list the contents of the folder /tmp/DIT003-PAAS004-PAAS2.3.4-deploy_dbd_22768

      10.25.51.191,Info,"Mar 30, 2015 9:53:05 AM",total 0

      10.25.51.191,Info,"Mar 30, 2015 9:53:05 AM",Exit Code 0

      "Run at Mar 30, 2015 9:52:48 AM",Info,"Mar 30, 2015 9:53:05 AM",The job 'extractParamValueForJob' has succeeded

       

      If I run the same script using nsh.bat I get the correct result  The main diff between two is first one is run as a NSHScriptJob using the BLA UI and the following one is thru the command line.

      C:\Users\nlakshmi\blscripts>nsh.bat majatalkies.nsh

      03-30-2015

      The following script starts, C:/Users/nlakshmi/blscripts/majatalkies.nsh

      The script is running on the host DC1PRBLTS12

      About to execue blcli_execute ImportExport exportObject 111 DBKey:SJobModelKeyImpl:5443223-2-89158778 /cygdrive/c/Users/nlakshmi/AppData/Local/Temp/DIT003-PAAS004-PAAS2.3.4-deploy_dbd_22768

      Now let us list the contents of the folder /cygdrive/c/Users/nlakshmi/AppData/Local/Temp/DIT003-PAAS004-PAAS2.3.4-deploy_dbd_22768

      total 203

      -rwx------   1 NLAKSHMI mkpasswd   102178 Mar 30 10:03 blexport.xml

      drwx------   1 NLAKSHMI mkpasswd        0 Mar 30 10:03 files

      -rwx------   1 NLAKSHMI mkpasswd     1106 Mar 30 10:03 mapping.xml

       

       

      Any help is very much appreciated.

        • 1. Re: ImportExport and no output
          Narahari Lakshminarayana

          Adding further what I found is that if I change the job from the

          Execute the script Separately  option to Execute the script once passing the host list as a parameter to the script.

          then the  job works fine.


          The above approach prevents me from defining a specific machine to run the export.

          bmc.png

          • 2. Re: ImportExport and no output
            Bill Robinson

            what output are you looking for here ?

             

            when you use the type 1 (runscript) job it's cd'd over to the target server and then running the blcli commands.  the blcli is still running on the appserver w/ the appserver's nsh/blcli but the path will be relative to the target since you are cd'd into it.  but many commands cannot take nsh paths so it's like that's the problem.  you are cd'd to //target.  then you run your command to export to /tmp/blah.  but that's actually //target/tmp/blah and the blcli probably can't deal w/ that.

             

            the type 2 (run once) type works because it doesn't cd to the targets first.

             

            so you have a couple options:

            type 1:

            # cd back to the appserver running the job

            cd //@

            run the blcli command,exports to /tmp on the appserver

            #copy the files to the target

            cp /tmp/export.zip //${NSH_RUNCMD_HOST}/tmp

             

            type 2:

            run the blcli command

            cp /tmp/export.zip //TARGET/tmp

             

            where target is the target server passed in w/ the %h