Home About BC DR HA Support Training Download
You are here: Home/ GlobalSysAdmin/ AIX/ Please Login or Register

-
Current Location
-

js
  GlobalSysAdmin
    AIX
-
AIX Admin Methodology
Global Consolidation Project
All AIX admins should join
www.aixexpert.com


Join our LinkedIn Group
AIX Advanced Technical Experts
Contract Opportunities

www.LinkedIn.com

-
digg Digg this page
del.icio.us Post to del.icio.us
Slashdot Slashdot it!


LPAR Leasing
Lease an AIX / i5 LPAR
Reduce your costs

www.mtxia.com

Server Leasing
Lease a Server off-site
Reduce your costs

www.mtxia.com

Data Center Automation
Business Continuity and DR
Virtualization/Consolidation

www.mtxia.com

HMC Service
Hardware Management Console
Manage Remote AIX / i5 LPARs

www.siteox.com

Business Web Site Hosting
$3.99 / month includes Tools,
Shopping Cart, Site Builder

www.siteox.com

Disaster Recovery
Small Business Oriented
Off-Site Facilities

www.mtxia.com

IBM pSeries / iSeries
Reduce your Costs
Off-Site Server Hosting

www.mtxia.com

The following script will reprocess and reorder the DISK* fields in the NMON data from the "csv" files. This script specifically grabs the lines of data beginning with "DISK" from the "csv" file and removes those disks which are NOT "Tru-copied" or VPATH disks. The Tru-Copy disks are identified as being part of the volume groups labeled 100 or higher.



#!/usr/bin/ksh93
################################################################

MACHNAME="${1:?ERROR: machine name not specified}"
DATE="${2:?ERROR: date string not specified}"

DISKLIST=${DISKLIST:-$( rsh ${MACHNAME} "for VPATH in \$( lspv | egrep -iv \"None|orabackupvg\" | grep -v \"egate1[0-9][0-9]\" | grep \"vpath\" | awk '{ print \$1 }' ); do lsvpcfg \${VPATH} | awk '{ print \$7, \$10 }' | grep \"hdisk\"; done" )}

egrep -v "^TOP,|^CPU" /usr/local/httpd/htdocs/nmon/${MACHNAME}/csv/${MACHNAME}_${DATE}_000[0-9].nmon.csv > /tmp/tmp0${$}.csv

grep "^DISK" /tmp/tmp0${$}.csv | awk -F, '{ print $1 }' | sort | uniq
for DISKPARM in $( grep "^DISK" /tmp/tmp0${$}.csv | awk -F, '{ print $1 }' | sort | uniq )
do

print "Working on ${MACHNAME}:${DATE}:${DISKPARM}..."

IFS=","
HEADER=$( grep "^${DISKPARM}," /tmp/tmp0${$}.csv | head -1 )
FIELDID=( NULL, ${HEADER} )

FIELDS='${1},${2}'
FIELDS=''

IFS=$' \t\n'

    for HDISK in ${DISKLIST}
    do
      [[ "_${HDISK}" = "_" ]] && continue
      ICNT=0
      for FIELD in "${FIELDID[@]}"
      do
        if [[ "_${FIELD}" = "_${HDISK}" ]]
        then
          FIELDS="${FIELDS},\${${ICNT}}"
          break
        fi
        (( ++ICNT ))
      done
    done

FIELDS="\${1},\${2}${FIELDS}"

# print "fields = ${FIELDS}"
# exit

IFS=$' \t\n'


cp /tmp/tmp0${$}.csv /tmp/tmp1${$}.csv
while read LINE
do
  if echo "${LINE}" | grep "^${DISKPARM}," > /dev/null 2>&1
  then
    IFS=","
    set -- ${LINE}
    IFS=$' \t\n'

    eval NEWLINE="\"${FIELDS}\""

    print "${LINE}" | sed -e "s|${LINE}|${NEWLINE}|g"
  else
    print "${LINE}"
  fi

done < /tmp/tmp1${$}.csv > /tmp/tmp0${$}.csv

done

cp /tmp/tmp0${$}.csv /usr/local/httpd/htdocs/nmon/${MACHNAME}/csv/${MACHNAME}_${DATE}_0000.nmon.tc.csv


-
NMON csv file reorder
-
 


LPAR Leasing
Lease an AIX / i5 LPAR
Reduce your costs

www.mtxia.com

Server Leasing
Lease a Server off-site
Reduce your costs

www.mtxia.com

Data Center Automation
Business Continuity and DR
Virtualization/Consolidation

www.mtxia.com

HMC Service
Hardware Management Console
Manage Remote AIX / i5 LPARs

www.siteox.com

Business Web Site Hosting
$3.99 / month includes Tools,
Shopping Cart, Site Builder

www.siteox.com

FREE Domain Registration
included with Web Site Hosting
Tools, Social Networking, Blog

www.siteox.com

Disaster Recovery
Small Business Oriented
Off-Site Facilities

www.mtxia.com

IBM pSeries / iSeries
Reduce your Costs
Off-Site Server Hosting

www.mtxia.com