10 Replies Latest reply on Jun 19, 2017 12:41 PM by Matthew Ragland

    Repare Broken RSCD Agent with Unified Install

      Hello,

      I have some broken RSCD agents in my infrastructure and I would like to use the unified installer to remove and install the same version of the RSCD agent. I cannot use standard upgrade job as the agent is not responding to BBSA.

       

      I noticed the "AgentInstallerScript.sh" created by the unified installer have some preinstall steps to check if there is already an RSCD agent installed. and there is an exit when a previous installation is detected.

       

      I would like to customize this script to permit a RE-Installation on an existing agent or a remove of the agent before the new installation.

       

      Can you tell me where this script is located ?

       

      Thanks  in advance.

      Eric

        • 1. Re: Repare Broken RSCD Agent with Unified Install
          Bill Robinson

          this script is created on the fly, i don't think there is a way to change what it runs.

          • 2. Re: Repare Broken RSCD Agent with Unified Install

            In your opinion, do you think I can propose a RFE to ask the implementation of flag or a modification of these scripts to permit a forced BSA Agent installation.

            • 4. Re: Repare Broken RSCD Agent with Unified Install
              Matthew Ragland

              Bill,

              Any chance you know where these script snippets live? You mention it is "created on the fly" but where is it created from? IMO allowing users to slip in their custom code here would be immensely helpful.

               

              cat AgentInstallerScript.sh

              #!/bin/sh

              #

              # This shell script was generated by the BMC BladeLogic Server Automation Console.

              # For more information please visit our website at http://www.bmc.com

              #

              # Date of creation: Fri Jun 16 12:49:00 PDT 2017

              #

               

              # Set a default path

              PATH=/bin:/sbin:/usr/bin:/usr/sbin:$PATH

               

              echo "Installation of the agent is starting."

               

              #

              # Do some validation of the machine first to confirm there is no agent.

              # We need to check both /usr/lib/rsc (pre-8.2) and /etc/rsc (8.2+)

              #

              if [ -f /usr/lib/rsc/HOME ]

              then

                  NSH_INSTALL=`cat /usr/lib/rsc/HOME`

                  if [ -d $NSH_INSTALL -a -f $NSH_INSTALL/bin/rscd ]

                  then

                      echo "An installation already exists at $NSH_INSTALL."

                      exit 98

                  fi

              fi

               

              if [ -f /etc/rsc/HOME ]

              then

                  NSH_INSTALL=`cat /etc/rsc/HOME`

                  if [ -d $NSH_INSTALL -a -f $NSH_INSTALL/bin/rscd ]

                  then

                      echo "An installation already exists at $NSH_INSTALL."

                      exit 98

                  fi

              fi

               

              #

              # Now validate whether or not the native package is already installed.

              #

              rpm -q BladeLogic_RSCD_Agent

              if [ $? = 0 ]

              then

                  echo "BladeLogic_RSCD_Agent is already installed."

                  exit 98

              fi

               

              #

              # The existence of /tmp/nsh-install-defaults will cause problems so rename it

              # if it's there.

              #

              if [ -f /tmp/nsh-install-defaults ]

              then

                  echo "/tmp/nsh-install-defaults exists, renaming to /tmp/nsh-install-defaults.old."

                  mv /tmp/nsh-install-defaults /tmp/nsh-install-defaults.old

                  if [ $? != 0 ]

                  then

                      echo "Failed to rename /tmp/nsh-install-defaults to /tmp/nsh-install-defaults.old"

                      exit 96

                  fi

              fi

               

               

              #

              # Agent config files now live in /etc/rsc.

              #

              if [ -d /etc/rsc ]

              then

                  NSHCONFDIR=/etc/rsc

              else

                  mkdir /etc/rsc

                  NSHCONFDIR=/etc/rsc

              fi

              # Execute installation command

               

              rpm -Uiv /BSA/stage/72d43d43-cc32-48ca-ad4c-ac163d799b3a_2_11/RSCD87-P4-LIN64.rpm

              EXIT_CODE=$?

              #

              if [ $EXIT_CODE != 0 ]

              then

                  exit $EXIT_CODE

              fi

              #

              # Agent config files now live in /etc/rsc.

              #

              if [ -d /etc/rsc ]

              then

                  NSHCONFDIR=/etc/rsc

              else

                  echo "Could not find the agent configuration directory /etc/rsc."

                  exit 97

              fi

              rm -f ${NSHCONFDIR}/exports

              cp "/BSA/stage/72d43d43-cc32-48ca-ad4c-ac163d799b3a_2_11/exports" ${NSHCONFDIR}

              EXIT_CODE=$?

              if [ $EXIT_CODE != 0 ]

              then

                  exit $EXIT_CODE

              fi

              rm -f ${NSHCONFDIR}/users

              cp "/BSA/stage/72d43d43-cc32-48ca-ad4c-ac163d799b3a_2_11/users" ${NSHCONFDIR}

              EXIT_CODE=$?

              if [ $EXIT_CODE != 0 ]

              then

                  exit $EXIT_CODE

              fi

              exit 0

              • 5. Re: Repare Broken RSCD Agent with Unified Install
                Bill Robinson

                probably in a jar in NSH/br/stdlib or in NSH/share somewhere.

                 

                 

                i've got to say it's not supported to go messing w/ these and they'll be wiped on upgrades.

                 

                 

                if you open a ticket and we find out it's because of some tinkering here, i'll call and yell at you that you shouldn't have messed around w/ it 

                • 6. Re: Repare Broken RSCD Agent with Unified Install
                  Matthew Ragland

                  Guys like me, keep guys like you in business

                  I think this is all about timing... If I can find a way to kick off the agent install job, and pause the job before it copies AgentInstallerScript.sh to the target, I can have another job go and update it. Kyle Sorg & I are stressing the limits of BSA every day, this is just a sampling... hahaha

                  • 7. Re: Repare Broken RSCD Agent with Unified Install
                    Bill Robinson

                    ?but don't you need a way to enhance that check ?  so if the rscd is installed, instead of having the aij skip the server, do some additional checks to figure out if/how broken it is ?  and then run whatever you want to run ?  i mean - you don't want to re-install on a working agent.

                     

                     

                    i haven't looked at it in a while but i thought the check to see if the rscd is already there was not in a script.

                    • 8. Re: Repare Broken RSCD Agent with Unified Install
                      Matthew Ragland

                      I pasted in the AgentInstallerScript.sh a few comments ago, it doesn't check for a "working" agent. It just checks to see if an agent ever existed on the target by checking for /etc/rsc/HOME and doing a rpm check for the BladeLogic RPM. These 2 checks will always resolve to true (on a broken RSCD agent). I agree, that the check definitely could be enhanced to add checks for the /etc/rsc/users.local & /etc/rsc/exports files (to compare to what we are attempting to deploy). Checking for the RSCD agent process running (ps -ef | grep rscd), and a plethora of other checks as well. Otherwise allow some sort of pre & post commands similarly to how patching works. Are you aware of any of these items on future BladeLogic roadmap?

                      • 9. Re: Repare Broken RSCD Agent with Unified Install
                        Bill Robinson

                        i'm not aware of any changes to the agent installer job... so idea...

                        • 10. Re: Repare Broken RSCD Agent with Unified Install
                          Matthew Ragland

                          Bill, I found the jar & corresponding java file needing to be modified. What are the chances we could get a custom JAR provided to us from BMC? Any chance you could put me in touch with a developer?