Monday, July 10, 2017

whatsup122 -- whats up 12.2 -- E-Business Suite 12.2 Services are Started/Running


Example:  AppsTier 12.2 Services are UP.  DBTier Services are UP.




           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


Example:  AppsTier 12.2 Services are DOWN.  DBTier Services are UP.



           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  No   No   No   No  No     Yes Yes      Yes Yes  Running Running




#!/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                                   #
#    -----------   ------------  --------------------------------------------  #
#                  M.Barone      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
}

No comments:

Post a Comment