6 Replies Latest reply on Jan 23, 2015 11:47 AM by Bill Robinson

    Understanding BSA Database Cleanup Script

      HI Experts,

       

      I have couple of things going in my mind since I have gone through BSA Recommended Database clean up Script. It has multiple mode w/ which one can execute associated cleanup job.

      BSA Version:8.5 SP1

       

      I am looking to run the job in specific modes and created multiple jobs for the same like application clean up, fileserver clean up, agent clean up and database clean up.)

       

      Application Server clean up job:

      Job run log: What does this mean and how can we fix this ?

       

      DB Clean up Job:

      ExecutionMode- CLEAN_DB

      ContinueOnError: true

      RetentionTime: 35

      Executed Against: One of Application server

      JObRun Log:

       

       

      What needs to be selected as target server(Target tab) in the NSH script job when mode is selected for DB cleanup ?

      What needs to be selected as target server(Target tab) in the NSH script job when mode is selected for Fileserver cleanup ?

      What needs to be selected as target server(Target tab) in the NSH script job when mode is selected for Agent cleanup ?

       

      Please guide...

        • 1. Re: Understanding BSA Database Cleanup Script
          Bill Robinson

          so first there's a problem w/ the blcli on your appserver it looks like.  can you run the blcli as the 'bladmin' user on the appserver or do you get the same error about the blcli log ?

           

          the answer to all 3 of your questions is the target doesn't matter because it's running blcli commands against the appserver, not against some target.  so you should have just a single target, which could be one of the appservers.  cleanup agent requires a list of agents supplied in the script's parameters.

          • 2. Re: Understanding BSA Database Cleanup Script

            Thanks bill.

             

            How can I provide list of target server in the script's parameters, specially when you want run agent cleanup against huge list ? 

            • 3. Re: Understanding BSA Database Cleanup Script
              Bill Robinson

              we need to re-work this script a little.

               

              imo you should just create another script that runs the agent cleanup blcli call and then target that against your agents to clean up like:

               

              blcli_execute Delete cleanupAgent ${NSH_RUNCMD_HOST} 3

               

              (or whatever the args are)

               

              however... w/ the 'type 1' script you need to be careful about parallelism. there is kind of a known issue where the spin up of the blcli jvm is expensive.  so if you run a type 1 script that calls the blcli and you have a high degree of parallelism (like 20+) you'll kill your appserver w/ all of the blcli spin ups.

               

              the alternative would be to use the type 2 script and loop through the targets, but that could be slow.

               

              another thing i thought of but haven't tried would be to call the cleanup command via webservices (soap) in the script, which i don't think will spin up additional JVMs.  but i haven't tried that.

              1 of 1 people found this helpful
              • 4. Re: Understanding BSA Database Cleanup Script
                Monoj Padhy

                try something like this for agent clean up...

                 

                #!/bin/nsh

                blcli_disconnect

                /usr/apps/bladelogic/NSH/bin/blcred cred -acquire -profile defaultProfile -i /usr/apps/bladelogic/NSH/br/user_info.dat

                blcli_setoption serviceProfileName defaultProfile

                blcli_setoption roleName BLAdmins

                blcli_init

                blcli_connect

                Servers_path=$1

                Retention=$2

                 

                blcli_execute Server listServersInGroup "${Servers_Path}" > /dev/null

                 

                blcli_storeenv Server_List

                 

                for Server in $Server_List; do

                echo "Cleaning up Agent in $Server for Retention Time is $Retention"

                blcli_execute Delete cleanupAgent $Server $Retention

                done

                blcli_disconnect

                 

                HTH

                1 of 1 people found this helpful
                • 5. Re: Understanding BSA Database Cleanup Script
                  Monoj Padhy

                  regarding this parallelism you can set a lower value (<=20) in the script job using Number of targets to process in parallel(General tab)

                   

                  Hopefully that will not give any load to your application server.

                   

                  Cheers...

                  • 6. Re: Understanding BSA Database Cleanup Script
                    Bill Robinson

                    if this is a nsh job, you don't need any of that...just target it to a list of servers or group and run the command i noted