DBAmon post
Posted in 1993
Netters,
Here is the promised DBAmon. Walt shar'ed it (thank you Walt). Please
let me know your comments - what we can do to improve it. There are a
couple of readme files which should explain things. If they don't - write.
j.
_____________________________________________________________________________
Jack Parker - Contractor |
Hewlett Packard, BSMC Boise, Idaho, USA| I've forgotten more than
jparker@hpbs2561.boi.hp.com | I ever knew
(208) 323-5388 (W) (208) 384-1623 (H) |
_____________________________________________________________________________
---- cut here ----------------------------------------------------------------
#!/bin/sh
#
# This is a shell archive. To extract its contents,
# execute this file with /bin/sh to create the file(s):
#
# README.dbamon README.engines dbamon online.engines
#
# This shell archive created: Fri Mar 26 15:43:45 EST 1993
#
echo "Extracting file README.dbamon"
sed -e 's/^X//' <<\\SHAR_EOF > README.dbamon
X DBAmon
X
X The first three sections (seperated by '###') are your configurable parms
X such as who and how, and thresholds to warn about - once exceeded.
X
X Note: this program is still under modification and not everything is
X perfect. Specifically the tbtape -c check has been commented out.
X this was written in a hurry to provide a desperately needed
X functionality. It has served very well. Now that we have a real DBA
X I'm sure it will become far much more perfecter.
X
X Also Note: we just moved it from a sleep loop to cron, so advantage is
X not fully taken of the 'day checks' versus the hourly checks.
X
X Also Also Note: This program IS A HOG. All of these tbstats can really
X mount up. We run it about 4 times daily.
X
X Also Also Also Note: DBAmon only sends warnings when something has changed
X since the last time it was run (assuming you don't wipe the /tmp files).
X
X Also Also Also Also Note: If you use this program and it breaks something,
X that's your problem not mine. It shouldn't break anything, but JIC.
X
X_____________________________________________________________________________
XJack Parker - Contractor |
XHewlett Packard, BSMC Boise, Idaho, USA| I've forgotten more than
Xjparker@hpbs2561.boi.hp.com | I ever knew
X(208) 323-5388 (W) (208) 384-1623 (H) |
X_____________________________________________________________________________
X
SHAR_EOF
if [ `wc -c < README.dbamon` -ne 1455 ]
then
echo "Lengths do not match -- Bad Copy of README.dbamon"
fi
echo "Extracting file README.engines"
sed -e 's/^X//' <<\\SHAR_EOF > README.engines
XThis file describes each of the engines on a platform, we keep it in
X/users/informix :
X
X#: This line is a comment and will not be used by DBAmon. It is the
X header for this file. Any line beginning with a '#' will be treated
X as such.
X
XDBSERVERNAME: is the name of the server from tbconfig. It is used for
X informational purposes only
X
Xconfig_file: is the name of your tbconfig file
X
Xserver_no: is SERVERNUM from tbconfig (I know, repetitious) not used.
X
Xtbtape-c?: (y/n) should a tbtape -c be running for this process? (continuous
X backup)
X
Xarch_level: For our archive process, lists the archive schedule. One digit
X for each day e.g. 0122122
X
Xgrps: the groups who have access to this engine. Used in our std.profile
X to set pointers to engines. For example suppose you have two
X engines 'aa' and 'bb'. Furthermore you have three groups for
X each engine aa_dev, aa_usr, aa_test ... by entering an 'aa'
X in grps all groups who have 'aa' in their group name will have
X access to this engine.
X
Xsqlexec: What sqlexec should be running (sqlturbo, sqlexec) used by /etc/rc
X
Xprofile: What profile (if any) should be run for a user accessing this engine
X
Xsqlexecd?: (y/n) whether an I-Star deamon should be running for this engine.
X used by /etc/rc. Should be checked by DBAmon but is not yet.
X
Xno_of_tapes: (int) used by archive to warn operator how many tapes are expected.
X again this is a seven day thing - e.g. 2211211
SHAR_EOF
if [ `wc -c < README.engines` -ne 1500 ]
then
echo "Lengths do not match -- Bad Copy of README.engines"
fi
echo "Extracting file dbamon"
sed -e 's/^X//' <<\\SHAR_EOF > dbamon
X#!/bin/ksh
X############################################################################
X#
X# Shell to monitor DB Engine performance.
X#
X# Jack Parker, Contractor, HP Boise Surface Mount Center 12/92
X#
X############################################################################
XDBA=informix@hpbs106 # who to tell of problems
Xalert_cmd=mailx # how to tell them.
Xdayct=8 # only print some figures every $dayct loops
Xeng_file=/users/informix/online.engines # engine definition file
X
X # Monitor thresholds - tell DBA after this level is passed.
X # note these are PER DAY figures.
X############################################################################
Xo_buff_th=50 # Over buffer
Xo_user_th=10 # Over users
Xo_lock_th=10 # Over locks
Xo_tbls_th=10 # Over Tables (too many requests for tblspace)
Xo_buf_wt_th=10 # buffer waits
Xo_lck_wt_th=10 # lock waits
Xo_doa_lck_th=10 # Deadlocks
Xo_dltout_th=10 # Deadlock timeouts
Xo_lchwait_th=10 # latch waits
Xo_ckp_wt_th=10 # checkpoint waits
X
X # note these are NOT per day figures.
X###########################################################################
Xrcache_th=95 # read cache %
Xwcache_th=82 # write cache %
Xpcnt_th=20 # disk full at 20 percent free
Xlgf_th=66 # log files are full - 66 %
Xb_m_th=90 # buffers are too small
Xb_l_th=75 # buffers are too big
Xlg_full_th=75 # Logical log device is full
Xmfr_th=5000 # how much memory should be free
Xlst_arch_th=1 # how many days ago should archive have been?
X############################################################################
X
X######commented out until I get a chance to see what's happening#########
X
X # tbtape -c running?
X#chk_tbtape()
X#{
X#no_tps=`grep -v "^#" $eng_file |cut -d":" -f 4|grep -c y`
X#norun=`ps -e | grep -c "tbtape -c"`
X#if [ -z "$norun" ]
X# then norun=0
X# fi
X#if [ -z "$no_tps" ]
X# then no_tps=0
X# fi
X#no_tps=`expr $no_tps \\* 2`
X#if [ $no_tps -ne $norun ]
X#then
X# echo "\\nOnly $norun of the $no_tps continuous backups are running!"
X#fi
X#}X
X###############################################################################
X # get list of engines from system file
X # format is: (user maintained)
X #Engine_Name:config_file:server_no:tbtape-c?:arch_level:grps
Xget_engines()
X{
Xengines=`grep -v "^#" $eng_file | cut -d":" -f 1`
X}
X
X###############################################################################
X # how many days has eng