Xymon Mailing List Archive search

Roracle

4 messages in this thread

list Ryan Jay B. Lapuz · Thu, 8 Nov 2007 08:59:26 +0800 ·
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   To: user-ae9b8668bcde@xymon.invalid   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:user-651f11aa7267@xymon.invalid]   Sent: Tuesday, 6 November 2007 10:18 PM
  To: user-ae9b8668bcde@xymon.invalid
  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.
list Vernon Everett · Thu, 8 Nov 2007 11:29:23 +0900 ·
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
quoted from Ryan Jay B. Lapuz

 
From: Ryan Jay B. Lapuz [mailto:user-945139049f37@xymon.invalid] 
Sent: Thursday, 8 November 2007 9:59 AM
To: user-ae9b8668bcde@xymon.invalid
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:user-9da1a1882f49@xymon.invalid>  
	To: user-ae9b8668bcde@xymon.invalid 
	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:user-651f11aa7267@xymon.invalid] 
	Sent: Tuesday, 6 November 2007 10:18 PM
	To: user-ae9b8668bcde@xymon.invalid
	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.
list Alexandre Levin · Wed, 7 Nov 2007 23:07:01 -0800 ·
I'm using bb-roracle  (2.21a) on SPARC/Solaris9 , Oracle 10g

Default ksh works just fine 

Script works on the client side.

 
What you need:

1.       Create oracle user with only connect and select any table
privileges 

2.       Extract Roracle-2-21a.tar.gz in temporary location  

3.       Copy ext/ bb-roracle.ksh to $HOBBITCLIENTHOME/ext

4.       Copy etc/ bb-roracle.dbtab , etc/bb-roracle.def,
etc/bb-roracle.ids to $HOBBITCLIENTHOME/etc

5.       Edit bb-roracle.dbtab

You can leave only default settings:

grep -v ^# bb-roracle.dbtab

                
@:DATABASE_DEFAULT:94:97:80:95:85:75:85:75:85:75:30:15:80:90:N:85:95:85:
95:8:15:33:10:5:60

@:SYSTEM:90:95

@:connect_data:90:95

6.       Edit bb-roracle.def

a.       ORATAB=xxxx

b.      DFT_ORACLE_HOME=xxx

c.       ORA_PROCS=

7.       Edit bb-roracle.ids

One line like:

LOCAL   NAME_OF_SID   dbuser password          abc.Efghijkl.nop..
dbserver,mycompany,com     LISTENER

 
Clientlaunch.cfg:

 
[roracle]

        ENVFILE $HOBBITCLIENTHOME/etc/hobbitclient.cfg

        CMD $HOBBITCLIENTHOME/ext/bb-roracle.ksh

        LOGFILE $HOBBITCLIENTHOME/logs/roracle.log

        INTERVAL 5m

 
Try it and it should work  J 

 
Alexander Levin
quoted from Ryan Jay B. Lapuz

 
From: Ryan Jay B. Lapuz [mailto:user-945139049f37@xymon.invalid] 
Sent: Wednesday, November 07, 2007 4:59 PM
To: user-ae9b8668bcde@xymon.invalid
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:user-9da1a1882f49@xymon.invalid>  

	To: user-ae9b8668bcde@xymon.invalid 

	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:user-651f11aa7267@xymon.invalid] 
	Sent: Tuesday, 6 November 2007 10:18 PM
	To: user-ae9b8668bcde@xymon.invalid
	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.
list Alexandre Levin · Wed, 7 Nov 2007 23:19:29 -0800 ·
As an addition to Roracle,  feel free to  use following script ( on the
client in the ext folder ) to chart ( ncv ) tablespace usage:

 
================

#!/usr/local/bin/python

 
import os

import sys

import cx_Oracle

import StringIO

import socket

import time

import string

 
#

BB = os.environ["BB"]

BBTMP = os.environ["BBTMP"]

BBDISP = os.environ["BBDISP"]

 
os.environ['BBPROG'] = 'ora-tbs.py'

 
TEST = 'oratbs'

os.environ['TEST'] = TEST

 
MACHINE = socket.gethostname()

MACHINE = string.replace(MACHINE, '.', ',')

 
DATE = time.strftime("%a %b %d %H:%M:%S %Z %Y",
time.localtime(time.time()))

 
connection = cx_Oracle.connect("dbuser/password")

 
sql = """ SELECT F.TABLESPACE_NAME,

         TO_CHAR ((T.TOTAL_SPACE - F.FREE_SPACE),'999,999') "USED (MB)",

         TO_CHAR (F.FREE_SPACE, '999,999') "FREE (MB)",

         TO_CHAR (T.TOTAL_SPACE, '999,999') "TOTAL (MB)",

         TO_CHAR ((ROUND ((F.FREE_SPACE/T.TOTAL_SPACE)*100)),'999')
PER_FREE

       FROM   (

           SELECT TABLESPACE_NAME,

           ROUND (SUM (BLOCKS*(SELECT VALUE/1024

                  FROM V$PARAMETER

                  WHERE NAME = 'db_block_size')/1024)

              ) FREE_SPACE

       FROM DBA_FREE_SPACE

       GROUP BY TABLESPACE_NAME

       ) F,

       (

         SELECT TABLESPACE_NAME,

         ROUND (SUM (BYTES/1048576)) TOTAL_SPACE

         FROM DBA_DATA_FILES

         GROUP BY TABLESPACE_NAME

       ) T

       WHERE F.TABLESPACE_NAME = T.TABLESPACE_NAME ORDER BY 1

       """

 
cursor = connection.cursor()

cursor.arraysize = 50

cursor.execute (sql)

i1 = cursor.fetchall()

 
output = StringIO.StringIO()

 
for z in range(i1.__len__()):

  print >> output, i1[z][0].ljust(15) + " : " + i1[z][4]

 
L0 = output.getvalue()

output.close()

 
COLOR = 'green'

 
LINE = "status " + MACHINE + "." + TEST + " " + COLOR + " " + DATE + "
Tablespaces on " + MACHINE + '\n' + L0

 
cmd = BB + ' ' + BBDISP + ' "' + LINE + '"'

 
os.system(cmd)
quoted from Alexandre Levin

 
=============== 

 
Alexander Levin

 
From: Ryan Jay B. Lapuz [mailto:user-945139049f37@xymon.invalid] 
Sent: Wednesday, November 07, 2007 4:59 PM
To: user-ae9b8668bcde@xymon.invalid
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:user-9da1a1882f49@xymon.invalid>  

	To: user-ae9b8668bcde@xymon.invalid 

	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:user-651f11aa7267@xymon.invalid] 
	Sent: Tuesday, 6 November 2007 10:18 PM
	To: user-ae9b8668bcde@xymon.invalid
	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.