2 Replies Latest reply on Apr 14, 2013 2:03 PM by Bill Robinson

    Help with a script debug

      I am working on a site to deploy 8.2.04 along 8.0 environment. Customer has some scripts that we need to test with 8.2.04 version. Upon running the scipts getting the following results:

       

      1) Create BLPackage:

       

      createBLPackageDeployJob () {

         # Function Takes 4 Arguments

       

         # PURPOSE:

         # Create the Deploy Job that will deploy a blpackage

       

         if [ $MCAFEE_DEBUG = "true" ]

         then

            echo "In createBLPackageDeployJob"

         fi

       

         # Name of the Deploy Job

         DEPLOY_JOB_NAME=$1 # Sample Input: "some name" etc....

         # Job Folder where you want to save this job

         JOB_GROUP_NAME=$2 # Sample Input: "/folder/structure/here" etc....

         # BL Package DBKey that you want to deploy

         PACKAGE_KEY=$3 # Sample Input:

         # A sample server to target the deploy against initially, this target will change later on in the ARM process

         TARGET_SERVER=$4 # Sample Input: "SERVERA" or "dalusapac10" etc....

        

         # script constants

         # Deploy type

         ADVANCED=1

         BASIC=0

         # Logging Level

         ERROR_ONLY=0

         ERROR_AND_WARNING=1

         ALL_INFO=2

         

         BLCLI_ERROR="Unable to Convert Job Group Name: $JOB_GROUP_NAME to Group Id"

         blcliExecute "$BLCLI_ERROR" JobGroup groupNameToId "${JOB_GROUP_NAME}"

         GROUP_ID=$RETURN_VALUE

       

         # Set Options on BL Deploy Job

         DEPLOY_TYPE=$ADVANCED

         

         SIMULATE=true

         COMMIT=true

         INDIRECT=false

         

         LOG_LEVEL=$ALL_INFO

         EXECUTE_BY_PHASE=false

         RESET_ON_FAILURE=true

         ALLOW_ROLLBACK=true

         ROLLBACK_ON_FAILURE=true

         REBOOT_IF_REQUIRED=true

         COPY_LOCKED_FILES=true

         STAGE_AFTER_SIMULATE=true

         COMMIT_AFTER_STAGE=false

         

         BASIC_DEPLOY_OPTS="$SIMULATE $COMMIT $INDIRECT"

         ADVANCED_OPTS="$LOG_LEVEL"

         ADVANCED_OPTS="${ADVANCED_OPTS} $EXECUTE_BY_PHASE"

         ADVANCED_OPTS="${ADVANCED_OPTS} $RESET_ON_FAILURE"

         ADVANCED_OPTS="${ADVANCED_OPTS} $ALLOW_ROLLBACK"

         ADVANCED_OPTS="${ADVANCED_OPTS} $ROLLBACK_ON_FAILURE"

         ADVANCED_OPTS="${ADVANCED_OPTS} $REBOOT_IF_REQUIRED"

         ADVANCED_OPTS="${ADVANCED_OPTS} $COPY_LOCKED_FILES"

         ADVANCED_OPTS="${ADVANCED_OPTS} $STAGE_AFTER_SIMULATE"

         ADVANCED_OPTS="${ADVANCED_OPTS} $COMMIT_AFTER_STAGE"

         

         DEPLOY_OPTS="${BASIC_DEPLOY_OPTS} ${ADVANCED_OPTS}"

         

         # Create Deploy Job

         BLCLI_ERROR="Unable to Create BLPackage Deploy Job"

         blcliExecute "$BLCLI_ERROR" DeployJob createDeployJob "${DEPLOY_JOB_NAME}" $GROUP_ID $PACKAGE_KEY $DEPLOY_TYPE $TARGET_SERVER $DEPLOY_OPTS

         DEPLOY_JOB_KEY=$RETURN_VALUE

       

         # Set Deploy Job JOB_PART_TIMEOUT

         BLCLI_ERROR="Unable to set JOB_PART_TIMEOUT on Deploy Job"

         blcliExecute "$BLCLI_ERROR" Job setPropertyValue ${DEPLOY_JOB_KEY} JOB_PART_TIMEOUT 60

       

         # Set Deploy Job JOB_TIMEOUT

         #BLCLI_ERROR="Unable to set JOB_TIMEOUT on Deploy Job"

         #blcliExecute "$BLCLI_ERROR" Job setPropertyValue ${DEPLOY_JOB_KEY} JOB_TIMEOUT 20

       

         # Set Overwrite Read-Only Files on Deploy Job

         BLCLI_ERROR="Unable to Set Overwrite Read-Only Setting on BLPackage Deploy Job: ${DEPLOY_JOB_NAME} $DEPLOY_JOB_KEY"

         blcliExecute "$BLCLI_ERROR" DeployJob setOverwriteReadOnlyFilesPS "${JOB_GROUP_NAME}" "${DEPLOY_JOB_NAME}"

         DEPLOY_JOB_KEY=$RETURN_VALUE

       

      }

      =========================================================================================

      ARM CALL JOB 44793

       

      (DEBUG) BLCLI Command: blcli_execute DeployJob setOverwriteReadOnlyFilesPS /McAfee ARM Jobs/Major Releases/44793/CURRENT_DEPLOY_JOBS_GROUP_A 44793-CONTENT-us.mcafee.com-distribution-GROUP_A

       

      Unable to Set Overwrite Read-Only Setting on BLPackage Deploy Job: 44793-CONTENT-us.mcafee.com-distribution-GROUP_A DBKey:SJobModelKeyImpl:35-1-2006969

       

      Command execution failed. com.bladelogic.om.infra.cli.factory.CommandNotFoundException: Name space : DeployJob has no commands by name : setOverwriteReadOnlyFilesPS

      =========================================================================================

       

      2) Create BatchJob:

       

      # Creating Site Batch Job

         FIRST_TIME="True"

         for JOB_MEMBER in $JOB_LISTING

         do

            JOB_DBKEY=$GLOBAL_SITE_DEPLOYJOB_DBKEYS_BY_JOB_NAME[$JOB_MEMBER]

       

            if [ $FIRST_TIME = "True" ]

            then

                FIRST_TIME="False"

                BLCLI_ERROR="Unable to create batch job: $BATCHJOB_NAME"

       

               if [ $MCAFEE_TYPE_RELEASE = "major" ]

               then

                   blcliExecute "$BLCLI_ERROR" BatchJob createBatchJobParallelPS "$BATCHJOB_NAME" $BATCHJOB_GROUP_ID $JOB_DBKEY $bContinueOnError $bRunParallel $bOverrideTargets

                   #blcliExecute "$BLCLI_ERROR" BatchJob createBatchJob "$BATCHJOB_NAME" $BATCHJOB_GROUP_ID $JOB_DBKEY $bContinueOnError $bExecuteByStage $bOverrideTargets

               elif [ $MCAFEE_TYPE_RELEASE = "micro" ]

               then

                   blcliExecute "$BLCLI_ERROR" BatchJob createBatchJobParallelPS "$BATCHJOB_NAME" $BATCHJOB_GROUP_ID $JOB_DBKEY $bContinueOnError $bRunParallel $bOverrideTargets

               fi

       

               BATCHJOB_DBKEY=$RETURN_VALUE

               # Use the returned DBKey to add more jobs to the Batch Job.

            else

               BLCLI_ERROR="Unable to add to batch job: $BATCHJOB_NAME"

               blcliExecute "$BLCLI_ERROR" BatchJob addMemberJobByJobKey $BATCHJOB_DBKEY $JOB_DBKEY

              BATCHJOB_DBKEY=$RETURN_VALUE

            fi

         done

       

      =========================================================================================

      ARM CALL JOB 44794

       

      (DEBUG) BLCLI Command: blcli_execute BatchJob createBatchJobParallelPS 44794-BATCH-Commit_Release_Batch_Job-GROUP_A 2000984 DBKey:SJobModelKeyImpl:37-1-2006991 true true false

       

      Unable to create batch job: 44794-BATCH-Commit_Release_Batch_Job-GROUP_A

       

      Command execution failed. com.bladelogic.om.infra.cli.factory.CommandNotFoundException: Name space : BatchJob has no commands by name : createBatchJobParallelPS

      =========================================================================================

        • 1. Re: Help with a script debug
          Siddu angadi

          There is no namespace called createBatchJobParallelPS

           

          In your script replace the createBatchJobParallelPS with CreateBatchJob

           

          Thanks

          Siddu

          • 2. Re: Help with a script debug
            Bill Robinson

            Siddu - the blcli 'namespace' is like 'BatchJob' or 'Job'.  the 'createXXX' are the 'commands'.  Typically when the command has a 'PS' in the name that's referring to a complex command that BMC PS created for the customer.  This would be in a xml file in NSH/br/xml/cli on the appserver, probably w/ 'PS' in the filename.  Did you copy over the custom files from the old environment to the new environment ?

            1 of 1 people found this helpful