#!/usr/bin/ksh #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>># #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>># #<<<<<<<<<<<<<+-----------------------------------+>>>>>>>>>>>>>># #<<<<<<<<<<<<<| GS320 reports script created by |>>>>>>>>>>>>>># #<<<<<<<<<<<<<| Premson P. R. |>>>>>>>>>>>>>># #<<<<<<<<<<<<<|-----------------------------------|>>>>>>>>>>>>>># #<<<<<<<<<<<<<| Created on: 17-05-2001 |>>>>>>>>>>>>>># #<<<<<<<<<<<<<+-----------------------------------+>>>>>>>>>>>>>># #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>># #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>># #<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>># #<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>># #<<+----------------------------------------------+>># #<<| Just before you fire this script ... |>># #<<| |>># #<<| - Rename the file report-app.ddmmm -> app |>># #<<| - Rename the file report-db.ddmmm -> db |>># #<<| - Run the following command -> sh use |>># #<<| - The final report name -> final |>># #<<+----------------------------------------------+>># #<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>># #<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>># # Truncates data from 08:00 to 22:30 for APP & DB cat app | awk '/08:00:0/,/22:30:0/' > rapp cat db | awk '/08:00:0/,/22:30:0/' > rdb # Get the time for every 30 mins cat rapp | grep "IST 2002" | awk '{print $4}' | sed "s/22:30:0//" > gstime # Gets the uptime for GS320APP cat rapp | grep "load average" > 1 # Gets the uptime for GS320APP cat rdb | grep "load average" > 2 # Gets the total number of users in GS320APP cat rapp | grep "load average" | awk '{print $6}' > appusers # Gets the load average of GS320APP cat rapp | grep "load average" | awk '{print $10}' | sed "s/,//g" > appload # Gets the load average of GS320DB cat rdb | grep "load average" | awk '{print $10}' | sed "s/,//g" > dbload cat rapp | awk '/iowait/,/iostat/' | sed "s/iostat out put//g" > appvm # Gets the iowait of GS320DB cat rdb | awk '/iowait/,/iostat/' | sed "s/iostat out put//g" | awk '{print $17}' | sed -n "3p;10p;17p;24p;31p;3 8p;45p;52p;59p;66p;73p;80p;87p;94p;101p;108p;115p;122p;129p;136p;143p;150p;157p;164p;171p;178p;185p;192p;199p" > dbiow # Gets the cpu idle status of GS320DB cat rdb | awk '/iowait/,/iostat/' | sed "s/iostat out put//g" | awk '{print 100-$16}' | sed -n "3p;10p;17p;24p;3 1p;38p;45p;52p;59p;66p;73p;80p;87p;94p;101p;108p;115p;122p;129p;136p;143p;150p;157p;164p;171p;178p;185p;192p;199 p" > dbcpu # Gets the cpu idle status of GS320APP cat rapp | awk '/iowait/,/iostat/' | sed "s/iostat out put//g" | awk '{print 100-$16}' | sed -n "3p;10p;17p;24p; 31p;38p;45p;52p;59p;66p;73p;80p;87p;94p;101p;108p;115p;122p;129p;136p;143p;150p;157p;164p;171p;178p;185p;192p;19 9p" > appcpu # Gets the iostat in bps for dsk9 cat rdb | awk '/dsk9/,/dsk24/' | grep -v dsk24 | grep -v dsk7 | awk '{print $7}' | sed -n "3p;9p;15p;21p;27p;33p ;39p;45p;51p;57p;63p;69p;75p;81p;87p;93p;99p;105p;111p;117p;123p;129p;135p;141p;147p;153p;159p;165p;171p;" > dsk 9 # Gets the iostat in bps for dsk8 cat rdb | awk '/dsk9/,/dsk24/' | grep -v dsk24 | grep -v dsk7 | awk '{print $9}' | sed -n "3p;9p;15p;21p;27p;33p ;39p;45p;51p;57p;63p;69p;75p;81p;87p;93p;99p;105p;111p;117p;123p;129p;135p;141p;147p;153p;159p;165p;171p;" > dsk 8 # Gets the tns ping for sec tba & temp respectively cat rapp | awk '/Port=1523/,/Port=1521/' | grep "OK (" | sed "s/OK (//g" | sed "s/msec)//g" > sec cat rapp | awk '/Port=1521/,/Port=1522)/' | grep "OK (" | sed "s/OK (//g" | sed "s/msec)//g" > tba cat rapp | awk '/Port=1522/,/msec)/' | grep "OK (" | sed "s/OK (//g" | sed "s/msec)//g" > temp pr -m -t -s gstime appcpu dbcpu appusers tba sec temp > 1h pr -m -t -s 1h dsk8 dsk9 appload dbload dbiow > 2h #<<< Sample program for catting format with the main report >>># cat use | awk '/GS320 Statistics/,/Extratruncate/' | grep -v awk | sed "s/#//g" | sed "s/Extratruncate//" > form # GS320 Statistics Report # ======================= # #Time CpuApp CpuDb UsrsApp Tnstba Tnssec Tnstemp Iodsk8 Iodsk9 LoadApp LoadDb IowDb #---- ------ ----- ------- ------ ------ ------- ------ ------ ------- ------ ----- # # Extratruncate cat form 2h > final #<<<<<< Clean up process >>>>>>>># rm 1 2 gstime appusers appload dbload appvm sec tba temp dbiow dbcpu appcpu dsk8 dsk9 rapp rdb form 1h 2h clear; cat final