[hobbit] Roracle

Everett, Vernon Vernon.Everett at woodside.com.au
Thu Nov 8 03:29:23 CET 2007


Hi Ryan
 
First off, please don't call me "sir". I am neither a knight of the
realm, nor a military officer, and damn proud of it. :-)
 
I have two Oracle tools.
The first one, ora-alert is a simple script I cobbled together to
monitor the alert logs.
You set it up to run on the client as documented in the Hobbit help
pages, and it needs an alert log tab file called 
$BBHOME/etc/alert_log.tab
This needs to contain the Oracle SID and the alert log file.
It will go yellow whenever an ORA error is generated, and red for an
ORA-00600 (Feel free to modify as required)
Output on the Hobbit detailed view will include the log entry.
Pretty simple, and so short, I include it below.
 
The other is a very comprehensive database monitor, which is a slightly
modified bb-roracle script
(Unfortunately, I had many problems getting bb-roracle to run with the
default Solaris version of ksh, and had to modify the script quite a
bit.)
I downloaded a different version of ksh, which I have unfortunately no
longer have - despite what I said in an earlier mail :-(
I also do not remember what version it was.
You can put any new ksh binary anywhere you want, as long as the #!
entry on the first line of your script points to it.
 
However, on looking again, I think the original roracle was designed to
work with pdksh, available here http://web.cs.mun.ca/~michael/pdksh/
My reason for thinking this is this piece of code in bb-roracle, 
    #cat $BBTMP/TABLESPACE.${ORACLE_SID}.$$|while read inTables;do
    while read inTables;do
Although both of these lines do the same thing in a different way, this
is a common workaround for a pdksh bug.
	From the pdksh docs -  `echo hi | read x' does not set x in the
current shell - the read is done in a separate process
Download pdksh, and see if you can get bb-roracle working with it. I am
sure if it works, it will be better than my hacked version.
 
The other downside, is, I have completely forgotten how I implemented
the defaults, or if I used bb-roracle or bb-voracle script. (I think it
was bb-voracle, but both are included to cover my butt)
Download the bb-roracle from deadcat and check the docs, and do a diff
with my files.
I also recall there being a $BBHOME/etc/bb-roracle.def which contained
all the definitions and defined a $ORATAB
I think $ORATAB contianed the SID and the alert log location, but I
can't be sure any more.
Again, check what's in the original bb-roracle.
 
Sorry I can't be more helpful, but it has been a long time since I
worked as a DBA and monitored Oracle with Hobbit, and I have forgotten a
lot.
(A lesson to the rest of you - document everything you do, or you might
end up like me)
I also thought I had more than just the scripts, which might be pretty
useless without the correct version of ksh.
 
Have fun and good luck.
 
Regards
     Vernon
 
P.S. In line with the mailing list "no attachments" policy, I will mail
you the files direct.
Anybody else who wants them, flick me an email.
 
cat ora-alert.ksh
#!/usr/bin/ksh

OutFile=$BBHOME/tmp/oraalert.$$

# Get the list of alert logs
while read ORACLE_SID LOG_FILE
do
	COLOUR=green
	if [ -f $BBHOME/tmp/ALERT.$ORACLE_SID ]
	then 
		LastLine=$(cat $BBHOME/tmp/ALERT.$ORACLE_SID)
	else
		# Could be the first time run
		LastLine=0
	fi
	FileLen=$(wc -l $LOG_FILE | awk '{ print $1 }')
	tail +$LastLine $LOG_FILE > $BBHOME/tmp/Log.$ORACLE_SID 
	# We can now look at the most recent additions to the Log file
	((FileLen=FileLen+1))
	[ $FileLen -lt $LastLine ] && LastLine=0 # The log was truncated
	[ $FileLen -eq $LastLine ] && echo "No new entries in log file"
>> $BBHOME/tmp/Log.$ORACLE_SID
	echo "$FileLen" > $BBHOME/tmp/ALERT.$ORACLE_SID 
	grep "^ORA-" $BBHOME/tmp/Log.$ORACLE_SID > /dev/null &&
COLOUR=yellow
	grep "^ORA-00600" $BBHOME/tmp/Log.$ORACLE_SID > /dev/null &&
COLOUR=red
	echo "" > $OutFile
	echo $LOG_FILE >> $OutFile 
	echo "" >> $OutFile
	cat $BBHOME/tmp/Log.$ORACLE_SID >> $OutFile
	echo "" >> $OutFile
	echo "" >> $OutFile
	$BB $BBDISP "status ${ORACLE_SID}.oraalert $COLOUR $(date) $(cat
$OutFile)"
	rm $OutFile
done < $BBHOME/etc/alert_log.tab

 

________________________________

From: Ryan Jay B. Lapuz [mailto:rlapuz at fcpp.fujitsu.com] 
Sent: Thursday, 8 November 2007 9:59 AM
To: hobbit at hswn.dk
Subject: Re: [hobbit] Roracle


Hi sir!
 
I'm running oracle on solaris sparc. Could you please help me make it
work. Right now I'm still monitoring tablespace manually because I was
not able to implement it with hobbit. Please make the procedure as
simple as possible because I have limited knowledge in oracle.
 
Thank you very much!
Ryan

	----- Original Message ----- 
	From: Everett, Vernon <mailto:Vernon.Everett at woodside.com.au>  
	To: hobbit at hswn.dk 
	Sent: Wednesday, November 07, 2007 7:38 AM
	Subject: RE: [hobbit] Roracle

	Hi Stefan
	 
	If by Roracle you refer to bb-roracle script available from
deadcat, then yes, I have used it. (This contract, a few years back.
Still have the scripts and ksh binary)
	Damn useful, once you get it working. Gave some good info. I
don't think it did any graphing, but I may be wrong.
	 
	The problem I encountered had to do with the subtle differences
between different implementations of ksh. I suspect this is where you
are getting stuck too.
	Yes, ksh differs from one version to the next, and the
implementation I had on my server (Solaris Sparc) was just never going
to work.
	 
	Eventually, I got so fed up, I downloaded a different version of
ksh, and put it in the ~hobbit directory structure, and changed the #!
line to point to the new ksh.
	It was a horrible fix, but the best I could do under the
circumstances. :-(
	 
	If you are running Solaris on Sparc, I can send you what I have,
but if you on a different architechture and OS, you are pretty much on
your own.
	 
	Cheers
	      V
	 

________________________________

	From: Stefan van der Walt [mailto:skjoldar at gmail.com] 
	Sent: Tuesday, 6 November 2007 10:18 PM
	To: hobbit at hswn.dk
	Subject: [hobbit] Roracle
	
	
	Have any of you installed this addon into hobbit?
	
	The instructions are sparse, and I just need to know how to get
the client to know the 
	addon is there?
	
	Thanks
	Stefan
	
	NOTICE: This email and any attachments are confidential. 
	They may contain legally privileged information or 
	copyright material. You must not read, copy, use or 
	disclose them without authorisation. If you are not an 
	intended recipient, please contact us at once by return 
	email and then delete both messages and all attachments.
	

NOTICE: This email and any attachments are confidential. 
They may contain legally privileged information or 
copyright material. You must not read, copy, use or 
disclose them without authorisation. If you are not an 
intended recipient, please contact us at once by return 
email and then delete both messages and all attachments.



More information about the Xymon mailing list