FW: [Nagiosplug-devel] FW: Nagios / Perl oracle monitoring script

Ken Munson Ken.Munson at dalsemi.com
Wed Aug 7 14:27:03 CEST 2002


Aaron,
 
YOU ARE MY HERO!   Thank you VERY VERY MUCH for sending this.  I had a small
problem with my tnsnames.ora file but once I got that squared away it
worked!!
 
I really can't thank you enough.  I have 50 or  more hours in on this.  It
took me a good bit to get the DBI/DBD stuff working.  It is this kind of
help that keeps the whole linux/perl/nagios (open source in general) thing
going strong.  In turn I will help ANYONE I can on the nagios (or any other
for that matter) user list.
 
Thank you again!
 
Ken Munson 
 
Also thanks to Paul DeLong and Andrew Mayhew for there help.  The best thing
about all this is no one even hammered me for being  "slow" on these
concepts which I obviously am.  THANKS!
 
 
 
 
 
 
 

-----Original Message-----
From: ABostick at mydoconline.com [mailto:ABostick at mydoconline.com]
Sent: Wednesday, August 07, 2002 2:57 PM
To: Ken.Munson at dalsemi.com; nagiosplug-devel at lists.sourceforge.net
Subject: RE: [Nagiosplug-devel] FW: Nagios / Perl oracle monitoring script


Ken,
 
I use that same script but had to modify it to get it to work.  Attached is
my modified version.
 
Aaron
 

-----Original Message-----
From: Ken Munson [mailto:Ken.Munson at dalsemi.com]
Sent: Wednesday, August 07, 2002 11:05 AM
To: nagiosplug-devel at lists.sourceforge.net
Subject: [Nagiosplug-devel] FW: Nagios / Perl oracle monitoring script



All, 

Hi, My name is Ken Munson and I work for Dallas Semiconductor in Dallas, TX.
I found a perl script for checking the state of Oracle table spaces in a
beta version tarball of some contributed plugins for Nagios.  It looks very
good.  I had a considerable challenge to get the DBD:Oracle and DBI modules
working with perl on my Redhat 7.3 system.   Now that I have them working I
can't quite seem to get the script to run correctly.  I am running it
against an Oracle 9i database that's on the same machine as Nagios - a test
database.   The script doesn't return any output to the command line.  I
have inserted print statements throughout the script (my perl skills are
sadly lacking) and have found that it goes through the whole script EXCEPT
for the block of code that follows:

while (($tbname, $total, $used, $pct_used) = $sth->fetchrow) 
{ 
        $pct_used=int($pct_used); 
        print STDOUT "size: " . $total . " MB Used:" . int($used) . " MB ("
. int($pct_used) . "%)\n"; 
        #print "table space $answer\n"; 
        if ($pct_used > $alertpct) { 
                if ($pct_used > $critpct) { 
                        $exit_code = 2 
                } else { 
                        $exit_code = 1; 
                } 
        } else { 
                $exit_code = 0; 
        } 
} 


I assume it is not executing this code because the condition of the while
statement is false.  My problem is I'm not good enough at troubleshooting
perl to tell why this "while" statement is false.  Especially in light of
the interwoven Oracle stuff that's in the script.  

I also moved the following two lines above the "while" command: 

$pct_used=int($pct_used); 
print STDOUT "size: " . $total . " MB Used:" . int($used) . " MB (" .
int($pct_used) . "%)\n"; 

and the screen output looks like this: 

size  MB Used: 0  MB 


Any insight you have would be VERY GREATLY appreciated.  I don't want to eat
up a bunch of your time but I thought if you knew something I could try that
comes to you quickly....you might enlighten me with it.

Thnaks very much for you time! 

Ken Munson 
972.371.4779 
ken.munson at dalsemi.com 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nagios-plugins.org/archive/devel/attachments/20020807/82a5228c/attachment.html>


More information about the Devel mailing list