• Monitoring, Scripts 12-29-2010 Comments Off

    http://oracle.3dub.com/scripts/tcpdump.sh.txt

  • Solaris 12-22-2010 Comments Off
    XSCF> showdcl -v -a
    DID   LSB   XSB   Status   No-Mem   No-IO    Float    Cfg-policy
    00                Running                             FRU
          00    00-0           False    False    False
          01    -
          02    -
          03    -
          04    -
          05    -
          06    -
          07    -
          08    -
          09    -
          10    -
          11    -
          12    -
          13    -
          14    -
          15    -
    XSCF> console -d 00 -f
    Connect to DomainID 0?[y|n] :y
    
  • HEADS UP 12-17-2010 Comments Off

    /o10g/grid/oracle/agent10g/OPatch/opatch lsinventory

  • Scripts 12-14-2010 Comments Off

    http://oracle.3dub.com/flex_function.sh.txt

  • Big Brother, Monitoring, Scripts 12-11-2010 Comments Off
    #!/bin/bash
    # parmanand.patram; 2010-12-11
    # create a single page to show all db /fra usage across the environment
    
    # SETUP
    LOGSDIR=/bb/bbvar/logs
    OUTFILE=/usr/local/bb/www/allfra/allfra.html
    TMPFILE=/usr/local/bb/www/allfra/fralines.tmp
    WORKDIR=/usr/local/bb/www/allfra
    
    cd $LOGSDIR
    
    #cleanup
    rm -f ${OUTFILE}*
    
    for file in `find . -name "*.disk" | sort`; do
            grep -i fra $file > $TMPFILE
            if [ -s "$TMPFILE" ]; then
                    SERVER=`echo $file  | sed 's/^..//' | awk -F'.' '{print $1}' | awk -F',' '{print $1}'`
    
                    while read line
                    do
                            COLOR="green"
                            #color the red ones
                            if [ ! -z "`echo $line | grep -i '\&red'`" ]; then
                                    COLOR="red"
                                    echo "
    
    
    " >> ${OUTFILE}.${SERVER}.red
                                    echo '
    $SERVER $line
    ' >> ${OUTFILE}.${SERVER}.red elif [ ! -z "`echo $line | grep -i '\&yellow'`" ]; then COLOR="yellow" echo " " >> ${OUTFILE}.${SERVER}.yellow echo '
    $SERVER $line
    ' >> ${OUTFILE}.${SERVER}.yellow else echo " " >> ${OUTFILE}.${SERVER}.green echo '
    $SERVER $line
    ' >> ${OUTFILE}.${SERVER}.green fi done < $TMPFILE fi done echo " " > $OUTFILE # show red cd $WORKDIR for i in `ls *.red` do cat $i >> $OUTFILE done # show yellow cd $WORKDIR for i in `ls *.yellow` do cat $i >> $OUTFILE done #show green for i in `ls *.green` do cat $i >> $OUTFILE done echo "
    " >> $OUTFILE
  • Big Brother, Monitoring, Scripts 12-11-2010 Comments Off
    #!/bin/sh
    
    #
    # $Revision: 1
    # $Date: 11/09/2010
    # $Author: Parm Patram
    # $Description: This scripts outputs the list of oracle databases to BBDISPLAY
    # $Instructions: Modify the variables BBHOME, LOG_HIST_COUNT and WARNCOLOR
    #                to match your system and monitoring requirements.
    #
    # Shamelessly stolen from the bb-who.sh script
    
    # Add to the clients in $BBHOME/etc/bb-bbexttab like so:
    # localhost: : bb-which_dbs.sh
    
    #
    # Uncomment the line below to run manually
    #
    
    #DEBUG="Y"
    
    #
    # INITIALIZE VARIABLES WE'LL BE NEEDING
    #
    TEST="DBS"                              # THE NAME OF OUR TEST
    CHANGE_COLOR="red"                       # Color to turn when new DB is found
    
    # When we find a new DB on the system, how long aferwards
    # should we continue to holler?
    DELAY_COUNT=5
    
    if test "$DEBUG" = "Y"
    then
            echo "*** DEBUG NOT IMPLEMENTED! ***"
    fi
    
    #################################################################
    #
    #   NO CONFIGURATION BEYOND THIS POINT
    #
    #################################################################
    
    #
    # Check that we have a basic environment setup
    #
    if test "$BBHOME" = ""
    then
            echo ERROR: BBHOME variable not set
            exit 1
    fi
    
    if test ! "$BBTMP"                      # GET DEFINITIONS IF NEEDED
    then
            # echo "*** LOADING BBDEF ***"
            . $BBHOME/etc/bbdef.sh          # INCLUDE STANDARD DEFINITIONS
    fi
    
    #
    # Initialization line
    #
    
    MACHINE=`hostname | $SED 's/\./,/g'`
    COLOR="green"
    DATE=`date`
    
    SENDFILE=$BBTMP/$TEST
    TESTFILE=$BBTMP/${TEST}.test
    COUNTFILE=$BBTMP/${TEST}.count
    COUNT=`/bin/cat $COUNTFILE`
    NEWDBS=$BBTMP/${TEST}.new
    MISSDBS=$BBTMP/${TEST}.missing
    /bin/ps -ef | /bin/grep ora_smon| /bin/grep -v grep | /bin/awk -F'_' '{print $3}'|sort| sed 's/^/DB:/' > $TESTFILE
    
    # make sure we have a SENDFILE, newfile and missing file
    touch $SENDFILE $NEWDBS $MISSDBS
    # send stderr to DBCHANGES to cater for any errors or
    # for when the thing first starts up.
    DBCHANGES=`/usr/bin/diff $SENDFILE $TESTFILE 2>&1`
    
    # See if there are any changes in the list of DBs
    if [ ! -z "$DBCHANGES" ]; then
            echo "Changes!"
            echo $DBCHANGES
            # increment the counts
            echo "Current count: $COUNT"
            let COUNT=$COUNT+1
            echo $COUNT > $COUNTFILE
            echo "New count: `/bin/cat $COUNTFILE`"
    
            # Let's see if it is time to stop hollering!
            if [ "$COUNT" -gt "$DELAY_COUNT" ]; then
                    echo "COUNT $COUNT exceeds treshold $DELAY_COUNT"
                    # update our sendfile
                    /bin/cp -f $TESTFILE $SENDFILE
                    # zero out the count
                    echo 0 > $COUNTFILE
                    # stop hollering
                    COLOR="green"
            else # we are still in alarm mode, identify the new and/or missing DBs
                    # generate new db list
                    echo "NEW DATABASES ON SYSTEM:" > $NEWDBS
                    /usr/bin/diff $SENDFILE $TESTFILE | /bin/grep ^\> | awk -F':' '{print $2}' >> $NEWDBS
                    echo "++++++++++++++++++++++++++++++" >> $NEWDBS
    
                    # generate missing db list
                    echo "DATABASES MISSING FROM SYSTEM:" > $MISSDBS
                    /usr/bin/diff $SENDFILE $TESTFILE | /bin/grep ^\< | awk -F':' '{print $2}' >> $MISSDBS
                    echo "++++++++++++++++++++++++++++++" >> $MISSDBS
    
                    echo "NEW: "; cat $NEWDBS
                    echo "MISSING: "; cat $MISSDBS
    
                    # check to see if the new and missing files are more than 2 lines
                    # long (header and footer)
                    if [ "`wc -l $MISSDBS | awk '{print $1}'`" -gt "2" ]; then
                            COLOR="yellow"
                    else
                            #null the missing file
                            cat /dev/null > $MISSDBS
                    fi
    
                    if [ "`wc -l $NEWDBS | awk '{print $1}'`" -gt "2" ]; then
                            COLOR="red"
                    else
                            #null the new file
                            cat /dev/null > $NEWDBS
                    fi
            fi
    fi
    
    CMD_OUT="status $MACHINE.$TEST $COLOR $DATE
    CURRENT DBS:
    `/bin/cat $TESTFILE`
    ++++++++++++++++++++++++++++++++
    `/bin/cat $NEWDBS`
    `/bin/cat $MISSDBS`
    "
    
    #
    # Send a status update to the Big Brother display unit
    #
    
    #
    # Debugging
    #
    if test "$DEBUG" = "Y"
    then
            echo "COLOR = ${COLOR}"
            `cat $BBTMP/$TEST`
            echo $CMD_OUT
    else
            echo $BB $BBDISP "$CMD_OUT"  # SEND IT TO BBDISPLAY
            echo $BB $BBDISP "$CMD_OUT" >> /tmp/bb-which_dbs.out
    fi
    
    # cleanup section
    #
    /bin/rm -f $NEWDBS $MISSDBS
    #
    # END OF bb-which_dbs.sh
    #
    
  • Vertias, VxFS 12-02-2010 Comments Off

    /etc/vx/voladm.d/bin/disk.list