7 Replies Latest reply on Jul 6, 2016 8:20 AM by Bill Robinson

    script nsh type pb find appserver

    Denis BACLE

      hello,

       

      i have a scrpit nsh and in my script i have need to know the name of appserver:

       

      APPSERVER=`cd;hostname`

       

      For certain target I have an error message:

       

      reUP_S1F1.nsh:cd:1: no such file or directory: /home/dev/application/sgaapp/G05R00C00/NSH/br --> this directory does not exist i my appserver, Why he(it) tries to look for this directory?

       

      i have not this directory?

       

       

      can you help me

        • 1. Re: script nsh type pb find appserver
          Bill Robinson

          what type of script is this ?  type 1 (runscript), type 2 (run once) ?

           

          where exactly do you get this error?

          can you attach the entire script and run log ?

          • 2. Re: script nsh type pb find appserver
            Denis BACLE

            it's a type 1

             

            the script is small:

             

            #!/bin/nsh
            # Recuperation des parametres du job, ie proprietes de la cible
            NAME=$1
            IP=$2
            OS=$3
            HOSTNAME=$4
            ENVIRONMENT=$5
            APPLICATION=$6

            # Serveurs, repertoires et fichiers
            APPSERVER=`cd;hostname`

            PASTEL_PATH="//${APPSERVER}/data/flf/sgaapp/InterfacePastel/Pastel_MakeList"
            PASTEL_SUP_DIR="/data/flf/sgaapp/supervision/JOBS/PASTEL"

            # Traitement avec les valeurs de proprietes recuperees par le job
            echo "${NAME},${IP},${OS},${HOSTNAME},${ENVIRONMENT},${APPLICATION}" >> ${PASTEL_PATH}/unitaire_${NAME}.csv

            • 3. Re: script nsh type pb find appserver
              Denis BACLE

              for example, i have the problem with the server dvdev181

              • 4. Re: script nsh type pb find appserver
                Bill Robinson

                the run log shows:

                 

                dvedvk40,Erreur,5 juil. 2016 04:08:26,touch: /data/flf/sgaapp/supervision/JOBS/PASTEL/SUP_PASTEL_UNITAIRE_UP_2: No such file or directory

                 

                yet i do not see the touch command called in the script you attached.  are you sure you attached the correct script ?

                • 5. Re: script nsh type pb find appserver
                  Denis BACLE

                  yes i have attached the good script

                  • 6. Re: script nsh type pb find appserver
                    Denis BACLE

                    the problem is with the command:

                     

                    APPSERVER=`cd;hostname`

                     

                    with the server dvdev181, this script is exected on 25000 servers but i have this problem with 10 servers.

                     

                    i have deleted the server in bladelogic, and added, the problem is the same.

                     

                    i have réinstalled  the agent bladelogic on the server dvdev181, but the pb is the same

                    • 7. Re: script nsh type pb find appserver
                      Bill Robinson

                      i'm not sure why you think decomissioning and re-adding the server or re-installing the agent would help here, especially if the problem is related to cd'ing back to the appserver running the job...

                       

                       

                      so look at your job run log.  i see this error:

                      dvedvk40,Erreur,5 juil. 2016 04:08:26,touch: /data/flf/sgaapp/supervision/JOBS/PASTEL/SUP_PASTEL_UNITAIRE_UP_2: No such file or directory

                       

                      something is clearly running a touch command and failing.  maybe it has the wrong path - whatever.  but the script you attached does not have a 'touch' command in it.  so please explain why you think you've attached the correct script and log ?

                       

                      this error shows that it's trying to touch a file on the target server (devedvk40) that does not exist. the particular file is declared here in the script you attached:

                      PASTEL_SUP_DIR="/data/flf/sgaapp/supervision/JOBS/PASTEL"

                       

                      except in the job run output it's actually got a SUP_PASTEL_UNITAIRE_UP_2 appended to it, which doesn't seem to be in your script.

                       

                      now, if you have similar script that is maybe using the same APPSERVER=`cd;hostname` that actually generated the log you attached - if you want to reference the appserver running the job you can use @ - eg //@/path/on/appserver.

                       

                      if you want to troubleshoot more you could add a 'set -x' to your actual script and see what happens w/ the cd and 'hostname' call.