#!/bin/sh # # getdash.sh # # Get instance test data for the infx instance dashbaord # Email output to jgh@jgharris.com. # # Setup INFORMIXSERVER, ONCONFIG, INFORMIXDIR and PATH first # # Disclaimer: # This program s provided as is, without any warranty of any kind, # either express or implied, including, but not limitied to, the # implied warranties of non-infringement, merchantability or fitness # for a particular purpose. The author shall not be liable for any # loss or damages arising out of your use of the program. # # Copyright: 2011 Jason Harris (jgh@jgharris.com), all rights reserved. # You may freely distribute this program. # # values to name the files with host=`uname -n` t=`date +%Y%m%d-%H%M` file=$host-$INFORMIXSERVER-$t # seperate file for each section onstat=$file.onstat onconfig=$file.onconfig msg=$file.msg tar=$file.tar # get onstat output onstat -i <$onstat -d -D -g arc -F -x -l -p -u -k -g dri -g con -g rea -g act -g arc -g ckp -g seg -g sql -g ses -g osi -g glo -g iov q EOF # get onconfig information onstat -c | sed -e "s/\t/ /g" >$onconfig # get message log log=`grep "^MSGPATH " $onconfig | sed -e "s/^MSGPATH *//" -e "s/ .*//"` if [ -f "$log" ] ; then tail -100 $log >$msg fi # make tar file with output rm -f $tar rm -f $tar.gz tar cvf $tar $file.* gzip $tar rm $file.onstat $file.onconfig $file.msg