Monday, July 10, 2017

whatsup121 -- whats up 12.1 -- What E-Business Suite 12.1 Services are UP/Running



Example:  AppsTier 11i/12.1 Services are UP.  DBTier Services are UP.

            oratest.oatcinc.com Apps-11i/12.1 Survey

            A p p l i c a t i o n           D a t a b a s e
               S e r v i c e s              S e r v i c e s
              --  Apache  --  App     App 11g 11g
 Apps     Frm Svr Svr Svr JRE DB      Cnc DB  Ora  WF-Java WF-Java
 SIDs     Svr iAS PLS 920 Svr Lnr     Mgr Lsr DB   Server  AgntLst
 -------- --- --- --- --- --- ---     --- --- ---  ------- -------
 oatc     Yes Yes Yes Yes Yes Yes     Yes Yes Yes  Running Running


             Current Activity
             ------------------------------
             Forms-Connections:           9
             ConcReqs Running:            2

             Daily Activity
             ------------------------------
             Web-AppsLocalLogin Today:   20



Example:  AppsTier 11i/12.1 Services are DOWN.  DBTier Services are UP.

              oratest.oatcinc.com Apps-11i/12.1 Survey

            A p p l i c a t i o n           D a t a b a s e
               S e r v i c e s              S e r v i c e s
              --  Apache  --  App     App 11g 11g
 Apps     Frm Svr Svr Svr JRE DB      Cnc DB  Ora  WF-Java WF-Java
 SIDs     Svr iAS PLS 920 Svr Lnr     Mgr Lsr DB   Server  AgntLst
 -------- --- --- --- --- --- ---     --- --- ---  ------- -------

 oatc     No  No  No  No  No  No      No  Yes Yes  Running Running







#!/bin/ksh
# whatsup ()
#------------------------------------------------------------------------------#
#    Module Name:  whatsup                                                     #
#                                                                              #
#    Purpose:      Report on the NCA Environment Oracle Applications 11i/12:   #
#                     Database, Database-Listener Apps-Listener, ConcManager,  #
#                     FormsWeb-Listener, Forms-Listener, Reports-Listener,     #
#                     TCF-Listener, Metric-Data-Listener, Metric-Req-Listener, #
#                     and Other Information.                                   #
#                                                                              #
#    Maintenance                                                               #
#    Date          Author        Description                                   #
#    -----------   ------------  --------------------------------------------  #
#    10-Oct-2009   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  " # whatsup:    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:  Reset CNTL-C CNTL-D CNTL-\ After Password Protection     #
        #------------------------------------------------------------------#
        trap        2
        trap        3

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

#-----------------------------------------------------------------------------#
#-  Initializing                                                             -#
#-----------------------------------------------------------------------------#
echo
echo "                         $HNAME Apps-11i Survey "
echo
echo "            A p p l i c a t i o n   ConcManager     D a t a b a s e"
echo "               S e r v i c e s       Services       S e r v i c e s"
echo "          --      Apache       --    App App      11g 11g"
echo " Apps     Frm Svr Svr Svr OPM App    DB  Cnc      DB  Ora  WF-Java WF-Java"
echo " SIDs     Svr iAS PLS 10g Svr Lnr    Lnr Mgr      Lsr DB   Server  AgntLst"
echo " -------- --- --- --- --- --- ---    --- ---      --- ---  ------- -------"

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

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

        #---------------------------------------------------------------------#
        #-  Running Processes for FORMWEB Server                             -#
        #---------------------------------------------------------------------#
        FRMIND=$(ps -efa | grep -v grep | grep $ORASIDLOWER | grep -c form)
        if  [[ $FRMIND -gt 0 ]]
        then
          typeset      FRMSVR="Yes"
        else
          typeset      FRMSVR="No "
        fi

        #---------------------------------------------------------------------#
        #-  Running Processes for FORMWEB Server                             -#
        #---------------------------------------------------------------------#
        FRMIND=$(ps -efa | grep -v grep | grep $ORASIDLOWER | grep -c frmweb)
        if  [[ $FRMIND -gt 0 ]]
        then
          typeset -i   FRMCNT=${FRMIND}
          typeset -i   FRMWEB=$FRMCNT
        else
          typeset -i   FRMWEB=$FRMIND
        fi

        #---------------------------------------------------------------------#
        #-  Running Processes for Apache iAS HTTP WebServer                  -#
        #---------------------------------------------------------------------#
        APAIND=$(ps -efa | grep -v grep | grep $ORASIDLOWER | grep Apache | \
        grep -c http)

        if  [[ $APAIND -gt 0 ]]
        then
        typeset   APAIAS="Yes"
        else
        typeset   APAIAS="No "
        fi

        #---------------------------------------------------------------------#
        #-  Running Processes for Apache iAS RotateLogs WebServer            -#
        #---------------------------------------------------------------------#
        APAIND=$(ps -efa | grep -v grep | grep $ORASIDLOWER | grep Apache | \
        grep -c rotatelogs)

        if  [[ $APAIND -gt 0 ]]
        then
        typeset   APAPLS="Yes"
        else
        typeset   APAPLS="No "
        fi

        #---------------------------------------------------------------------#
        #-  Running Processes for Apache 10g WebServer                       -#
        #---------------------------------------------------------------------#
        APAIND=$(ps -efa | grep -v grep | grep $ORASIDLOWER | grep Apache | \
        grep -c http)

        if  [[ $APAIND -gt 0 ]]
        then
        typeset   APA10g="Yes"
        else
        typeset   APA10g="No "
        fi

        #---------------------------------------------------------------------#
        #-  Running Processes for (OPM) Java Runtime Executables             -#
        #---------------------------------------------------------------------#
        OPMIND=$(ps -efa | grep opmn | grep -v grep | grep -ic $ORASID)

        if  [[ $OPMIND -gt 0 ]]
        then
        typeset   OPMSVR="Yes"
        else
        typeset   OPMSVR="No "
        fi

        #---------------------------------------------------------------------#
        #-  Running Processes for Database LSNRCTL (Listener)                -#
        #---------------------------------------------------------------------#
        LSNNAM=$(grep DB_LISTENER $CONTEXT_FILE | cut -f2 -d'>' | cut -f1 -d'<')
        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 $ORASID)
          if  [[ $APPIND -gt 0 ]]
          then
                typeset   APPMGR="Yes"
          fi
        done

        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/whatsup.cnt

        SELECT count(*)
        FROM   fnd_concurrent_requests
        WHERE  phase_code = 'R';
        EXIT;

ENDFILE

        if  [[ -f /tmp/whatsup.cnt ]]
        then
            CNCREQ=$(tail -2 /tmp/whatsup.cnt | head -1)
            rm /tmp/whatsup.cnt
        fi

        #---------------------------------------------------------------------#
        #-  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/whatsup.wfm

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

ENDFILE

        if  [[ -f /tmp/whatsup.wfm ]]
        then
            ORAWFM=$(tail -2 /tmp/whatsup.wfm | head -1 | cut -c1-7)
            rm /tmp/whatsup.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/whatsup.wfl

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

ENDFILE

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

        #---------------------------------------------------------------------#
        #-  Processes for Apache Connections                                 -#
        #---------------------------------------------------------------------#
        APADIR=$IAS_ORACLE_HOME/Apache/Apache/logs/access_log
        if  [[ -f ${APADIR}* ]]
        then
            APALOG=$(ls -t $APADIR.*  | head -1)
            APADTE=$(date '+%d/%b/%C%y')
            APAWEB=$(grep '$APADTE' $APALOG | grep -c AppsLocalLogin.jsp)
        fi

    #-------------------------------------------------------------------------#
    #-  Print Detail Line                                                    -#
    #-------------------------------------------------------------------------#
    echo \
" $APPSID   $FRMSVR $APAIAS $APAPLS $APA10g $OPMSVR $LSNAPP    $LSNADB $APPMGR      $LSNDBA $ORASVR  $ORAWFM $ORAWFL "


    echo
    echo
    echo "             Current Activity"
    echo "             ------------------------------"
    echo "             Forms-Connections:           $FRMWEB"
    echo "             ConcReqs Running:   $CNCREQ"
    echo
    echo "             Daily Activity"
    echo "             ------------------------------"
    echo "             Web-AppsLocalLogin Today:    $APAWEB"
    echo
    done

    #-------------------------------------------------------------------------#
    #-  Print Blank Line                                                     -#
    #-------------------------------------------------------------------------#
    echo
}

No comments:

Post a Comment