14 Replies Latest reply on Mar 19, 2013 7:12 PM by S Crawford

    Creating a single NSH script job to upgrade RSCD agents...?

    S Crawford

      Hi,

       

      We have thousands of Unix RSCD agent sthat need to be upgraded to 8.2.1.  The versions of Unix vary from AIX 5.x/6.x/7.x, RHEL 3.x-6.x, RHEL zLinux 5.x, Solaris 8/9/10 x86 and SPARC. 

       

      With this many variations of Unix in our environment, we would need to create several agent upgrade file deploy jobs and would only be able to apply targets with that exact OS version to the job.  Especially since there are numerous BL installation files for the same OS but with different architectures, versions, etc.

       

      I would rather have a single NSH script job (or one for each OS if needed) instead of one for each BL installation file.  What I'm thinking of doing is having the NSH script determine the OS and version, and do a cp //$source_server //$target_server with the correct install file, and then run the silent install commands.

       

      Is there a disadvantage to upgrading the agents this way compared to creating separate deploy jobs for each BL agent variation? 

       

      I like the simplicity of being able to just populate the list of Unix target servers into one job instead of having to determine the OS version and architecture and creating separate lists to populate to multiple deploy jobs.  Not to mention we have a time-consuming BladeLogic Script/Job SDLM process here, and having to create multiple jobs will add additional overhead in getting them promoted into our BladeLogic production environment.

       

      Thanks

        • 1. Re: Creating a single NSH script job to upgrade RSCD agents...?
          Bill Robinson

          or you can have the nsh job figure out what the target is, then run the appropriate file deploy job for the platform.

           

          when you nexec the installer it's going to cut off the agent connection so you need to figure out a way to handle that.  the file deploy job post-install handles that fairly well.

          1 of 1 people found this helpful
          • 2. Re: Creating a single NSH script job to upgrade RSCD agents...?
            S Crawford

            Hi Bill,

             

            I tried going the all-in-one NSH script route using a 'sleep 120' command after the nexec install command is run.  I only tried it on AIX so far.  The job run log gives a bunch of false errors but it does seem to survive the agent restart. 

             

            We have many (the majority of our agents) still running on 7.5.0 and they need to be updated to 8.2.1.  The AIX BFF package upgrade worked fine for 8.0.6 to 8.2.1 upgrades, but it doesn't work from 7.5.0.  Then I found the documentation that says:

            Untitled.png:

            Using the .SH script with a -silent seems to work, but the old AIX package still shows up when we do an 'lslpp -l | grep bladelogic'.  Not optimal, but as long as the new agent works, we can live with it.

             

            Solaris and RHEL will be next, hopefully the 'sleep' method will work for those.  If not, I will end up doing a hybrid NSH script / Deploy job release based on OS. 

             

            Thanks,

            Scott

            • 3. Re: Creating a single NSH script job to upgrade RSCD agents...?
              S Crawford

              Currently testing RHEL and so far the sleep loop I have now created is working.  The script is able to detect when the agent comes back online and the job doesn't fail during this sleep time.

               

              I am moving onto Solaris now.  I remember there being a '-local' switch that was used for Solaris zones, but is this still an option with v8.2?  I don't see any mention of it in the BMC Server Automation 8.2 online documentation.


              http://docs.bmc.com/docs/display/public/bsa82/Installing+the+Solaris+agent

               

              Thanks

              • 4. Re: Creating a single NSH script job to upgrade RSCD agents...?
                Olivier Renault

                I have a file deploy job for each OS.

                In precommand I verify space disk and I create a symbolic link of install_dir because the filesystem of the agent is too small for an update (the prerequisite of the agent install growths version after version).

                In postinstall I lauch the upgrade like this for solaris 10 :

                 

                nohup sh /images/blade/RSCD800-911-SOL10SPARC.SH -silent -force >/tmp/RSCD800-911-SOL10SPARC.log 2>&1 &

                if [ $? -ne 0 ]

                then

                       echo "erreur lors de l'upgrade"

                       exit 1

                fi

                if [ -d /etc/signatures ]

                then

                        REPSIG=/etc/signatures

                else

                        REPSIG=/exec/signatures

                fi

                echo "rm -f $REPSIG/PI-SGA-BLA*.SIG ;touch $REPSIG/PI-SGA-BLA800S-SLG04R01C12.SIG;rm -rf /images/blade;rm -rf /images/install_dir" |at now +2 minutes 2>/dev/null

                exit 0

                • 5. Re: Creating a single NSH script job to upgrade RSCD agents...?
                  Bill Robinson

                  i would not expect running the SH based installer to make any changes to the package database so of course the old package information is still going to be there.

                  • 6. Re: Creating a single NSH script job to upgrade RSCD agents...?
                    Bill Robinson

                    another way you could do this is to use a component template and compliance rules to figure out what agent needs to be installed and then push out an upgrade via a blpackage.  if you use the 'out of band reboot' option on the install script in the blpackage it should work...

                    • 7. Re: Creating a single NSH script job to upgrade RSCD agents...?
                      S Crawford

                      What does the -force switch do in the Solaris installer?

                      • 8. Re: Creating a single NSH script job to upgrade RSCD agents...?
                        Sean Berry

                        Lets it ignore architecture be careful!

                        1 of 1 people found this helpful
                        • 9. Re: Creating a single NSH script job to upgrade RSCD agents...?
                          S Crawford

                          I'm having issues doing silent automated upgrades specifically on Solaris 10 Sparse Root Zones (trying to upgrade from 7.4.x and 7.5 mostly).  All other OS versions are upgrading through my all-in-one NSH script that handles the deployment and the install commands. 

                           

                          I tried separating the Solaris Sparse Zone installs out into a separate File Deploy Job with post-install commands.  My NSH script job sets the correct target in the job and then calls the File Deploy Job.  Here are the post-install commands that get run:

                           

                          mv /tmp/nsh-install-defaults_local /tmp/nsh-install-defaults

                          "/opt/BLOGrscd/sbin/agentctl" -b exec sh /tmp/RSCD82-SP1-SOL10-SPARC.sh -silent &

                          wait $!

                          NSHDIR=/opt/BLOGrscd/NSH

                          LD_LIBRARY_PATH=${LD_LIBRARY_PATH:=}${LD_LIBRARY_PATH:+:}/opt/BLOGrscd/NSH/lib

                          export LD_LIBRARY_PATH

                          export NSHDIR

                          cp /tmp/exports /tmp/users /tmp/users.local /opt/BLOGrscd/NSH/conf/

                           

                          Currently, the existing agent is installed in /opt/BLOGrscd.  If I just run the install line ("/opt/BLOGrscd/sbin/agentctl" -b exec sh /tmp/RSCD82-SP1-SOL10-SPARC.sh -silent) manually from a console session on the server, the upgrade will complete.  It doesn't copy over the config files (exports, users, users.local) files over to the new location (/opt/BLOGrscd/NSH/conf), which is why I am copying them to /tmp before the upgrade and copying them manually afterwards.

                           

                          If I run the File Deploy Job, the install command doesn't work.  The new agent directory never gets created (/opt/BLOGrscd/NSH).  I have tried multiple ways of calling the install script (nohup, with and without agentctl, using the -local switch before -silent in the command, setting and exporting KEEPLOCAL in nsh-install-defaults), but still no success.  Any ideas why it wouldn't be working through the job but works manually?

                          • 10. Re: Creating a single NSH script job to upgrade RSCD agents...?
                            S Crawford

                            For some reason, the installer never gets executed.  I have tried these 5 commands in the post-command section of the File Deploy Job:

                             

                            • "/opt/BLOGrscd/sbin/agentctl" -b exec sh /tmp/RSCD82-SP1-SOL10-SPARC.sh -local -silent
                            • /tmp/RSCD82-SP1-SOL10-SPARC.sh -silent
                            • nohup /tmp/RSCD82-SP1-SOL10-SPARC.sh -silent
                            • nohup "/tmp/RSCD82-SP1-SOL10-SPARC.sh -silent"
                            • nohup /tmp/RSCD82-SP1-SOL10-SPARC.sh -local -silent

                             

                            I get the same error in the nohup.out: "/tmp/RSCD82-SP1-SOL10-SPARC.sh: test: argument expected".  I don't see why it would be expecting a test argument.  Because of this, the installer never runs.

                            • 11. Re: Creating a single NSH script job to upgrade RSCD agents...?
                              Bill Robinson

                              i think for the local agent upgrade you need to do this:

                               

                               

                              NSHDIR=/opt/BLOGrscd/NSH

                              INSTALL_DIR=/opt/BLOGrscd

                              LD_LIBRARY_PATH=${LD_LIBRARY_PATH:=}${LD_LIBRARY_PATH:+:}/opt/BLOGrscd/NSH/lib

                              KEEPLOCAL=1

                              export LD_LIBRARY_PATH

                              export NSHDIR

                              export INSTALL_DIR

                              export KEEPLOCAL

                               

                              "/opt/BLOGrscd/sbin/agentctl" -b exec sh /tmp/RSCD82-SP1-SOL10-SPARC.sh -silent &

                               

                              also - was this installed originally by the pkg or the sh installer ?

                              • 12. Re: Creating a single NSH script job to upgrade RSCD agents...?
                                S Crawford

                                I tried changing the post-commands to what you listed above, but the upgrade still didn't work. It did manage to bring down the running agent, but nothing else beyond that. There is no new NSH directory inside /opt/BLOGrscd and no BladeLogic_Install log file in /tmp, so I don't think it ever kicked off the upgrade.

                                 

                                Shouldn't NSHDIR and LD_LIBRARY_PATH be set after the upgrade kicks off, since the NSH directory doesn't exist until after the upgrade is completed?

                                • 13. Re: Creating a single NSH script job to upgrade RSCD agents...?
                                  Bill Robinson

                                  if the install is in /opt/BLOGrscd, then i think the original install was done w/ the package installer, not the sh installer and you should not be trying to upgrade w/ the sh installer.

                                  • 14. Re: Creating a single NSH script job to upgrade RSCD agents...?
                                    S Crawford

                                    I noticed you replied to my other thread as well.  I'll reply in that thread since that one was created specifically to address the Solaris Zone installs.  Thanks.

                                     

                                    Other Thread:

                                    https://communities.bmc.com/communities/message/307797#307797