9 Replies Latest reply on May 4, 2016 2:20 PM by Alan Nakashian-Holsberg

    Reboot is pending on this machine, analysis results may be in-correct

    Cody Dean

      Anyone know what mechanism BSA uses for this check?

       

      We have a script we run to see if a reboot is needed, and reboots the server if it is, and we check these keys, which is whats included in the patch redness compliance job, as well as a couple more.  Yet, we keep getting servers that pass this check, but throw the reboot required flag during analysis, and after a manual reboot, it has patches to install, so it did need a reboot.

       

      • 'reg_value_exists ("HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\PendingFileRenameOperations")'
      • 'reg_value_exists ("HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\WindowsUpdate\\\\Auto Update\\\\RebootRequired")'
      • 'reg_value_exists ("HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Component Based Servicing\\\\RebootPending")'
      • 'reg_value_exists ("HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\\\\Services\\\\lanmanserver\\\\parameters\\\\AutoShareServer")'
      • 'reg_value_exists ("HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Updates\\\\UpdateExeVolatile")'
      • 'reg_value ("HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Updates\\\\UpdateExeVolatile")'

       

      Thanks!

      Cody

        • 1. Re: Reboot is pending on this machine, analysis results may be in-correct
          Bill Robinson

          where in bsa are you seeing the 'needs reboot' exactly ?  can you show a screenshot ?

          • 2. Re: Reboot is pending on this machine, analysis results may be in-correct
            Cody Dean

            The "Pending Reboot Check with Reboot Script" that our Windows administrators came up with.

             

            Servers=$1

            ForceReboot=$2

            SleepFor=3

            TestIterations=200

            debug=""

             

             

            CheckForDownOrUp() {

              COUNT=1

              if [ $1 = "down" ]; then

              ER="0"; udTest="$ER"; udNote="$SCh Agent still running (checking again in $SleepFor seconds) ... "

              elif [ $1 = "up" ]; then

              ER="1"; udTest="$ER"; udNote="$SCh Agent still not up (checking again in $SleepFor seconds) ... "

              else

              echo "Error - we reached a place in the script we shouldn't have ..."

              fi

              agentinfo $host >/dev/null 2>&1

              ER=$? # $? contains 1 if previous command fails, 0 if ok

             

             

              while [ "$ER" -eq "$udTest" ]; do

              [[ "$COUNT" -gt "$TestIterations" ]] && echo "$SCh reboot problems (reached $TestIterations test iterations without change)" 1>&2 && break

              echo "$udNote (try $COUNT out of $TestIterations)"

              COUNT=$((COUNT+1))

              sleep $SleepFor

              agentinfo $host >/dev/null 2>&1

              ER=$? # $? contains 1 if previous command fails, 0 if ok

              done

            }

             

             

            for host in ${(o)Servers}; do # syntax : "for x in array; do; <stuff...>; done

              cd //@;disconnect

              let ServerCount=ServerCount+1

            # SCh="#$ServerCount, $host"

              SCh="$host" # Change for t1 script

             

             

              unset RebootNeededBecause

              #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

              # Reboot if script Paramater ForceReboot is set

              if [[ "$ForceReboot" == "NOW" ]] ;then

              RebootNeededBecause="$RebootNeededBecause ForceReboot"

              echo "$SCh ForceReboot Paramater set to $ForceReboot"

              else

            # Pending Reboot check section START

              #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

              # Reboot if RegValue PendingFileRenameOperations exists

              PendingFileRenameOperations="`blquery -h $host -e 'reg_value_exists ("HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\PendingFileRenameOperations")' | tr -d '[:cntrl:]'`"

              [[ "$PendingFileRenameOperations" = "1" ]] && RebootNeededBecause="PendingFileRenameOperations,"

              [[ -n $debug ]] && echo "$SCh $PendingFileRenameOperations Reg  PendingFileRenameOperations (reboot if 1)"

              #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

              # "Registry Key:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired"

              Auto_Update="`blquery -h $host -e 'reg_value_exists ("HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\WindowsUpdate\\\\Auto Update\\\\RebootRequired")' | tr -d '[:cntrl:]'`"

              [[ "$Auto_Update" = "1" ]] && RebootNeededBecause="$RebootNeededBecause Auto_Update,"

              [[ -n $debug ]] && echo "$SCh $Auto_Update Reg  Auto_Update (reboot if 1)"

              #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

              # "Registry Key:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending"

              Component_Based_Servicing="`blquery -h $host -e 'reg_value_exists ("HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Component Based Servicing\\\\RebootPending")' | tr -d '[:cntrl:]'`"

              [[ "$Component_Based_Servicing" = "1" ]] && RebootNeededBecause="$RebootNeededBecause Component_Based_Servicing,"

              [[ -n $debug ]] && echo "$SCh $Component_Based_Servicing Reg  Component_Based_Servicing (reboot if 1)"

              #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

              # HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters\AutoShareServer

              AutoShareServer="`blquery -h $host -e 'reg_value_exists ("HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\\\\Services\\\\lanmanserver\\\\parameters\\\\AutoShareServer")' | tr -d '[:cntrl:]'`"

              [[ "$AutoShareServer" = "1" ]] && RebootNeededBecause="$RebootNeededBecause AutoShareServer,"

              [[ -n $debug ]] && echo "$SCh $AutoShareServer Reg  AutoShareServer (reboot if 1)"

              #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

              # Reboot if RegValue WinSXSPending exists

              UpdateExeVolatile="`blquery -h $host -e 'reg_value_exists ("HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Updates\\\\UpdateExeVolatile")' | tr -d '[:cntrl:]'`"

              [[ -n $debug ]] && echo "$SCh $UpdateExeVolatile Reg  UpdateExeVolatile (if 1  check for any value),"

              UpdateExeVolatileHasAValue="0" # Set to 0, ie, reset it

              [[ "$UpdateExeVolatile" = "1" ]] && UpdateExeVolatileHasAValue="`blquery -h $host -e 'reg_value ("HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Updates\\\\UpdateExeVolatile")' | tr -d '[:cntrl:]'`"

              [[ "$UpdateExeVolatileHasAValue" != "0" ]] && RebootNeededBecause="$RebootNeededBecause UpdateExeVolatileHasAValue,"

              [[ -n $debug ]] && echo "$SCh $UpdateExeVolatileHasAValue Reg  UpdateExeVolatileHasAValue (reboot if 1)"

              #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

              # Reboot if file WinSXSPending exists

              WinSXSPending="`blquery -h $host -e 'file_is_regular ("/c/Windows/winsxs/pending.xml")' | tr -d '[:cntrl:]'`"

              [[ "$WinSXSPending" = "1" ]] && RebootNeededBecause="$RebootNeededBecause WinSXSPending,"

              [[ -n $debug ]] && echo "$SCh $WinSXSPending File WinSXSPending (reboot if 1)"

              #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

              # Reboot if file TimPleaseRebootMeNow.txt exists for ease of testing

              # [[ -n $debug ]] && TimPleaseRebootMeNow="`blquery -h $host -e 'file_is_regular ("/c/temp/TimPleaseRebootMeNow.txt")' | tr -d '[:cntrl:]'`"

              # [[ -n $debug ]] && [[ "$TimPleaseRebootMeNow" = "1" ]] && RebootNeededBecause="$RebootNeededBecause TimPleaseRebootMeNow"

              # [[ -n $debug ]] && echo "$SCh $TimPleaseRebootMeNow File TimPleaseRebootMeNow (reboot if 1)"

              #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            # Pending Reboot check section END

              fi

             

             

              if [ ! -z $RebootNeededBecause ]; then

              echo "$SCh RebootNeededBecause: $RebootNeededBecause \n$SCh Sending reboot"

              RebootOutput=`nexec $host reboot` # Call Reboot Here

              [[ -z "$RebootOutput" ]] && echo "$SCh Reboot Sent" || echo "$SCh Problem sending reboot command!"

              sleep $SleepFor

            # Checking for server to go down and come back up - Start

              CheckForDownOrUp down

              echo "$SCh Rebooted... waiting to come back up"

              CheckForDownOrUp up

              echo "$SCh is back up!"

            # Checking for server to go down and come back up - End

              else

              echo $SCh Reboot NOT Needed

              fi

              cd //@;disconnect

            done

            • 3. Re: Reboot is pending on this machine, analysis results may be in-correct
              Alan Nakashian-Holsberg

              Cody,

               

              Is this the same issue that Jim Wilber has a case (00130890) opened asking about?  If so, I have recently asked him to provide the patch analysis job run log and the application server log from the same time frame.

               

              Thank you

              • 5. Re: Reboot is pending on this machine, analysis results may be in-correct
                Cody Dean

                Ah yes - I checked and Jim does have a case open.  I will get the info over to him to submit into the ticket.

                • 6. Re: Reboot is pending on this machine, analysis results may be in-correct
                  Cody Dean

                  Just attached them to the ticket myself Alan - Thanks!

                  • 8. Re: Reboot is pending on this machine, analysis results may be in-correct
                    Bill Robinson

                    it looks like that message is thrown by looking at :

                     

                    HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update\\RebootRequired

                    HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\PendingFileRenameOperations

                    1 of 1 people found this helpful
                    • 9. Re: Reboot is pending on this machine, analysis results may be in-correct
                      Alan Nakashian-Holsberg

                      Cody,

                       

                      From the job run log, this was executed on hcv084bbsapaa01_job, you sent the logs for hcv084bbsapaa02_job.

                       

                      Analysis Run at 05/04/2016 13:17:15

                       

                      Info

                       

                      5/4/2016 13:17

                       

                      Executing work item Windows Patch Analysis Job:analysis-2005185-Windows Patch Analysis and Remediation2015-09-09 12-01-17-690-0400; Server:HCV391MMPIPAA07;  on application server: hcv084bbsapaa01_job