Tuesday, November 14, 2017

WhatScripts: E-Business Suite 12.2 -- Whatsup (Updated)

WhatScripts:  AppsTier 12.2 Services are UP.  DBTier Services are UP.
Each of the Scripts in this blog have been developed, tested and perfected on the following Computer Operating Systems:

            AIX                               HP/UX
            Oracle Linux                  Redhat Linux
Sun Solaris                    SuSe Linux

Each of these Scripts will prompt the user for the necessary password and the Script will automatically screen-protect the password so the password is NOT visible on the screen.  Additionally, each of these Scripts will monitor for the <CNTL><C> (cancel) or <CNTL><D> (delete) or  <CNTL> <X> exit.  So, if the Script-user cancels or stops the script, the password screen-protect settings are reversed and a normal terminal-setting resumes.


Each of these scripts MERELY SELECTS and DISPLAYS on the screen and simultaneously creates an identical file in the /tmp directory so you can review these results anytime.  The WhatScripts do NOT update any Database Tables, Rows, Columns nor Database Data. WhatScripts do NOT update any Configuration Files nor any Context Files nor any Setup Files.


            oratest.oatcinc.com Apps-12.2 Survey

           A p p l i c a t i o n   ConcManager    D a t a b a s e
             S e r v i c e s        Services      S e r v i c e s
          -OA-Framework  Apache-    App App      11g 11g
 Apps     OAFM OA   Frm  Frm App    DB  Cnc      DB  Ora  WF-Java WF-Java
 SIDs     Svr  Core C4WL Svr Lnr    Lnr Mgr      Lsr DB   Server  AgntLst
 -------- ---- ---- ---- --- ---    --- ---      --- ---  ------- -------
 OATC122  Yes  Yes  Yes  Yes Yes    Yes Yes      Yes Yes  Running Running


whatsup122:

#!/bin/ksh
# whatsup122 ()
#------------------------------------------------------------------------------#
#    Module Name:  whatsup122                                                  #
#                                                                              #
#    Purpose:      Report on the NCA Environment Oracle Applications 12.2:     #
#                     Database, Database-Listener Apps-Listener, ConcManager,  #
#                     OAFramework, OACore, FormsContainer4WebLogic, Forms      #
#                     and Other Information.                                   #
#                                                                              #
#    Maintenance                                                               #
#    Date          Author        Description                                   #
#    -----------   ------------  --------------------------------------------  #
#    10-Oct-2009   M.Barone      Module design/creation                        #
#                  T.Robinette   Module design/creation                        #
#                  T.Blanford    Module design/creation                        #
#------------------------------------------------------------------------------#
{
        DIRNAM=$(dirname $0)
        ORASID=$(echo $CONTEXT_NAME | cut -f1 -d'_')
        ORASRV=$(echo $CONTEXT_NAME | cut -f3 -d'_')
        HNAME=$(uname -n)

        clear
        echo
        echo  " #--------------------------------------------------------#"
        echo  " # whatsup122: Oracle Apps Services/Processes (Executing) #"
        echo  " #--------------------------------------------------------#"
        echo

        #------------------------------------------------------------------#
        #  Trap:  Set CNTL-C CNTL-D CNTL-\ Before Password Protection      #
        #------------------------------------------------------------------#
        trap        "stty echo; return"     2
        trap        "stty echo; return"     3
        stty -echo
        read PASSWD?" Please Enter the Oracle APPS Passwd: "
        stty echo
        echo

        trap        "stty echo; return"     2
        trap        "stty echo; return"     3
        stty -echo
        read PASSWL?" Please Enter the Oracle WebLogic Server Passwd: "
        stty echo
        echo

        #------------------------------------------------------------------#
        #  Trap:  Reset CNTL-C CNTL-D CNTL-\ After Password Protection     #
        #------------------------------------------------------------------#
        trap        2
        trap        3

        clear
        ORANAM=${ORASID}
        ORALST=${ORASID}

#-----------------------------------------------------------------------------#
#-  Initializing                                                             -#
#-----------------------------------------------------------------------------#
echo
echo "                   $HNAME Apps-12.2 Survey "                             \
   | tee /tmp/whatsup122_$$.txt
echo
echo "          A p p l i c a t i o n   ConcManager    D a t a b a s e"        \
| tee -a /tmp/whatsup122_$$.txt
echo "            S e r v i c e s        Services      S e r v i c e s"        \
| tee -a /tmp/whatsup122_$$.txt
echo "         -OA-Framework  Apache-    App App      11g 11g"                 \
| tee -a /tmp/whatsup122_$$.txt
echo " Apps    OAFM OA   Frm  Frm App    DB  Cnc      DB  Ora  WF-Java WF-Java"\
| tee -a /tmp/whatsup122_$$.txt
echo " SIDs    Svr  Core C4WL Svr Lnr    Lnr Mgr      Lsr DB   Server  AgntLst"\
| tee -a /tmp/whatsup122_$$.txt
echo " ------- ---- ---- ---- --- ---    --- ---      --- ---  ------- -------"\
| tee -a /tmp/whatsup122_$$.txt

#-------------------------------------------------------------------------#
#-  LOOP                                                                 -#
#-------------------------------------------------------------------------#
        for  ORASID  in $(echo $ORALST)
        do
        #---------------------------------------------------------------------#
        #-  Initialize LOOP Variables                                        -#
        #---------------------------------------------------------------------#
        typeset APPSID=$(echo "${ORASID}")
        ORASIDLOWER=$(echo $ORASID |   \
        sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')

        #----------------------------------------------------------------------#
        #  SHELL: Variables                                                    #
        #----------------------------------------------------------------------#

        #----------------------------------------------------------------------#
        #-  E-Business 12.2 -- Running OAFM/OACORE/Forms/Forms-C4WS           -#
        #----------------------------------------------------------------------#
        #- ./admanagedsrvctl.sh status oafm_server1        OAFM Server Status -#
        #- ./admanagedsrvctl.sh status oacore_server1    OACORE Server Status -#
        #- ./admanagedsrvctl.sh status forms-c4ws_server1 FORMS C4WS Status   -#
        #- ./admanagedsrvctl.sh status forms_server1      FORMS Server Status -#
        #----------------------------------------------------------------------#
        FRMIND=$(echo  ${PASSWL} | ${ADMIN_SCRIPTS_HOME}/admanagedsrvctl.sh \
                status  oafm_server1 2>/dev/null |  \
                grep -c 'oafm_server1 is running')

        if  [[ $FRMIND -gt 0 ]]
        then
          typeset      OAFSVR="Yes "
        else
          typeset      OAFSVR="No  "
        fi

        #----------------------------------------------------------------------#
        #-  E-Business 12.2 -- Running Processes for OACore                   -#
        #----------------------------------------------------------------------#
        FRMIND=$(echo  ${PASSWL} | ${ADMIN_SCRIPTS_HOME}/admanagedsrvctl.sh \
                status  oacore_server1 2>/dev/null |  \
                grep -c 'oacore_server1 is running')

        if  [[ $FRMIND -gt 0 ]]
        then
          typeset      OACSVR="Yes "
        else
          typeset      OACSVR="No  "
        fi
        #---------------------------------------------------------------------#
        #-  E-Business 12.2 -- Running Processes for FORMS Container for WLS -#
        #---------------------------------------------------------------------#
        FRMIND=$(echo  ${PASSWL} | ${ADMIN_SCRIPTS_HOME}/admanagedsrvctl.sh \
                status  forms-c4ws_server1 2>/dev/null |  \
                grep -c 'forms-c4ws_server1 is running')

        if  [[ $FRMIND -gt 0 ]]
        then
          typeset      FRMWLS="Yes "
        else
          typeset      FRMWLS="Yes "
        fi

        #----------------------------------------------------------------------#
        #-  E-Business 12.2 -- Running Processes for FORMS Server             -#
        #----------------------------------------------------------------------#
        FRMIND=$(echo  ${PASSWL} | ${ADMIN_SCRIPTS_HOME}/admanagedsrvctl.sh \
                status  forms_server1 2>/dev/null |  \
                grep -c 'forms_server1 is running')

        if  [[ $FRMIND -gt 0 ]]
        then
          typeset      FRMSVR="Yes"
        else
          typeset      FRMSVR="No "
        fi

        #---------------------------------------------------------------------#
        #-  Running Processes for Database LSNRCTL (Listener)                -#
        #---------------------------------------------------------------------#
        LSNNAM="tnslsnr $ORASID"
        if  [[ $LSNNAM != '' ]]
        then
            LSNIND=$(ps -efa | grep -i "$LSNNAM" | grep -v grep |  \
                     grep -c $ORASIDLOWER)
            if  [[ $LSNIND -gt 0 ]]
            then
                typeset   LSNDBA="Yes"
            else
                typeset   LSNDBA="No "
            fi
        else
            typeset   LSNDBA="No "
        fi

        #---------------------------------------------------------------------#
        #-  Running Processes for Apps LSNRCTL (Listener)                    -#
        #---------------------------------------------------------------------#
        typeset   LSNADB="No "
        typeset   LSNAPP="No "

        LSNIND=$(ps -efa | grep -i "APPS_${ORASID}*" | grep -v grep  \
        | grep -c $ORASID)
        if  [[ $LSNIND -gt 0 ]]
        then
            typeset   LSNADB="Yes"
            typeset   LSNAPP="Yes"
        fi

        #---------------------------------------------------------------------#
        #-  Running Processes for Oracle Instance                            -#
        #---------------------------------------------------------------------#
        ORAIND=$(ps -efa | grep -v grep | grep -c ora_pmon_${ORASID})

        if  [[ $ORAIND -gt 0 ]]
        then
        typeset   ORASVR="Yes"
        else
        typeset   ORASVR="No "
        fi

        #---------------------------------------------------------------------#
        #-  Running Processes: Concurrent Manager                            -#
        #---------------------------------------------------------------------#
        typeset   APPMGR="No "

        for FNDPIDS in $(ps -efa | grep FNDSM | grep -v grep | cut -c10-15)
        do
          APPIND=$(ps -efa |grep $FNDPIDS | grep -v grep | grep -i -c FNDSM)
          if  [[ $APPIND -gt 0 ]]
          then
                typeset   APPMGR="Yes"
          fi
        done

        #---------------------------------------------------------------------#
        #-  Processes for Oracle WorkFlow Notification Mail Server/Listener  -#
        #---------------------------------------------------------------------#
        WFMIND=$(ps -efa | grep -v grep | grep GSMSvcComponentContainer | \
        grep -c ${ORASIDLOWER})

        if  [[ $WFMIND -gt 2 ]]
        then
            typeset   ORAWFM="Running"
            typeset   ORAWFL="Running"
        else
            typeset   ORAWFM="Stopped"
            typeset   ORAWFL="Stopped"
        fi


        sqlplus -s apps/$PASSWD > /dev/null <<-ENDFILE
        set     heading         off
        set     feedback        off
        set     flush           off
        set     pause           off
        set     space           1
        set     termout         off
        set     verify          off
        set     linesize        80
        set     pagesize        0
        spool /tmp/whatsup122.wfm

        SELECT  INITCAP(component_status)
        FROM    fnd_svc_components
        WHERE   component_name = 'Workflow Notification Mailer';
        EXIT;

ENDFILE

        if  [[ -f /tmp/whatsup122.wfm ]]
        then
            ORAWFM=$(tail -2 /tmp/whatsup122.wfm | head -1 | cut -c1-7)
            rm /tmp/whatsup122.wfm
        fi

        sqlplus -s apps/$PASSWD > /dev/null <<-ENDFILE
        set     heading         off
        set     feedback        off
        set     flush           off
        set     pause           off
        set     space           1
        set     termout         off
        set     verify          off
        set     linesize        80
        set     pagesize        0
        spool /tmp/whatsup122.wfl

        SELECT INITCAP(component_status)
        FROM   fnd_svc_components
        WHERE  component_name = 'Workflow Inbound Notifications Agent Listener';
        EXIT;

ENDFILE

        if  [[ -f /tmp/whatsup122.wfl ]]
        then
            ORAWFL=$(tail -2 /tmp/whatsup122.wfl | head -1 | cut -c1-7)
            rm /tmp/whatsup122.wfl
        fi

    #-------------------------------------------------------------------------#
    #-  Print Detail Line                                                    -#
    #-------------------------------------------------------------------------#
    echo \
" $APPSID $OAFSVR $OACSVR $FRMWLS $FRMSVR $LSNAPP    $LSNADB $APPMGR      $LSNDBA $ORASVR  $ORAWFM $ORAWFL "                     | tee -a /tmp/whatsup122_$$.txt
    done


    #-------------------------------------------------------------------------#
    #-  Print Blank Line                                                     -#
    #-------------------------------------------------------------------------#
    echo                                         | tee -a /tmp/whatsup122_$$.txt

print
print "Please see /tmp/whatsup122_$$.txt"
print
}