<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>FW: Nagios / Perl oracle monitoring script</TITLE>

<META content="MSHTML 5.50.4522.1800" name=GENERATOR></HEAD>
<BODY>
<DIV>
<DIV class=OutlookMessageHeader><FONT face="Times New Roman" 
size=2></FONT></DIV><SPAN class=223105620-07082002><FONT face=Arial 
color=#0000ff size=2>Aaron,</FONT></SPAN></DIV>
<DIV><SPAN class=223105620-07082002><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=223105620-07082002><FONT face=Arial color=#0000ff size=2>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!!</FONT></SPAN></DIV>
<DIV><SPAN class=223105620-07082002><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=223105620-07082002><FONT face=Arial color=#0000ff size=2>I 
really can't thank you enough.  I have 50 or <SPAN 
class=417411521-07082002> more </SPAN>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.</FONT></SPAN></DIV>
<DIV><SPAN class=223105620-07082002><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=223105620-07082002><FONT face=Arial color=#0000ff size=2>Thank 
you again!</FONT></SPAN></DIV>
<DIV><SPAN class=223105620-07082002><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=223105620-07082002><FONT face=Arial><FONT color=#0000ff><FONT 
size=2>Ken Munson<SPAN 
class=417411521-07082002> </SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=223105620-07082002><FONT face=Arial><FONT color=#0000ff><FONT 
size=2><SPAN 
class=417411521-07082002></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV><SPAN class=223105620-07082002><FONT face=Arial><FONT color=#0000ff><FONT 
size=2><SPAN class=417411521-07082002>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!</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=223105620-07082002><FONT face=Arial><FONT color=#0000ff><FONT 
size=2><SPAN 
class=417411521-07082002></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV><SPAN class=223105620-07082002><FONT face=Arial><FONT color=#0000ff><FONT 
size=2><SPAN 
class=417411521-07082002> </SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=223105620-07082002></SPAN> </DIV>
<DIV><SPAN class=223105620-07082002><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=223105620-07082002><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=223105620-07082002><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=223105620-07082002><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader><FONT face="Times New Roman" 
  size=2>-----Original Message-----<BR><B>From:</B> ABostick@mydoconline.com 
  [mailto:ABostick@mydoconline.com]<BR><B>Sent:</B> Wednesday, August 07, 2002 
  2:57 PM<BR><B>To:</B> Ken.Munson@dalsemi.com; 
  nagiosplug-devel@lists.sourceforge.net<BR><B>Subject:</B> RE: 
  [Nagiosplug-devel] FW: Nagios / Perl oracle monitoring 
  script<BR><BR></FONT></DIV>
  <DIV><SPAN class=648215619-07082002><FONT face=Arial color=#0000ff 
  size=2>Ken,</FONT></SPAN></DIV>
  <DIV><SPAN class=648215619-07082002><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN> </DIV>
  <DIV><SPAN class=648215619-07082002><FONT face=Arial color=#0000ff size=2>I 
  use that same script but had to modify it to get it to 
  work.  Attached is my modified version.</FONT></SPAN></DIV>
  <DIV><SPAN class=648215619-07082002><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN> </DIV>
  <DIV><SPAN class=648215619-07082002><FONT face=Arial color=#0000ff 
  size=2>Aaron</FONT></SPAN></DIV>
  <DIV><SPAN class=648215619-07082002></SPAN> </DIV>
  <BLOCKQUOTE>
    <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
    size=2>-----Original Message-----<BR><B>From:</B> Ken Munson 
    [mailto:Ken.Munson@dalsemi.com]<BR><B>Sent:</B> Wednesday, August 07, 2002 
    11:05 AM<BR><B>To:</B> 
    nagiosplug-devel@lists.sourceforge.net<BR><B>Subject:</B> [Nagiosplug-devel] 
    FW: Nagios / Perl oracle monitoring script<BR><BR></FONT></DIV>
    <P><FONT face=Arial color=#000000 size=2>All,</FONT> </P>
    <P><FONT face=Arial size=2>Hi, My name is Ken Munson and I work for Dallas 
    Semiconductor in Dallas, TX.  I </FONT><FONT face=Arial color=#000000 
    size=2>found a</FONT><FONT face=Arial size=2> 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:</FONT></P>
    <P><FONT face=Arial size=2>while (($tbname, $total, $used, $pct_used) = 
    $sth->fetchrow)</FONT> <BR><FONT face=Arial size=2>{</FONT> <BR><FONT 
    face=Arial size=2>        
    $pct_used=int($pct_used);</FONT> <BR><FONT face=Arial 
    size=2>        print STDOUT "size: " . 
    $total . " MB Used:" . int($used) . " MB (" . int($pct_used) . 
    "%)\n";</FONT> <BR><FONT face=Arial 
    size=2>        #print "table space 
    $answer\n";</FONT> <BR><FONT face=Arial 
    size=2>        if ($pct_used > 
    $alertpct) {</FONT> <BR><FONT face=Arial 
    size=2>                
    if ($pct_used > $critpct) {</FONT> <BR><FONT face=Arial 
    size=2>                        
    $exit_code = 2</FONT> <BR><FONT face=Arial 
    size=2>                
    } else {</FONT> <BR><FONT face=Arial 
    size=2>                        
    $exit_code = 1;</FONT> <BR><FONT face=Arial 
    size=2>                
    }</FONT> <BR><FONT face=Arial 
    size=2>        } else {</FONT> <BR><FONT 
    face=Arial 
    size=2>                
    $exit_code = 0;</FONT> <BR><FONT face=Arial 
    size=2>        }</FONT> <BR><FONT 
    face=Arial size=2>}</FONT> </P><BR>
    <P><FONT face=Arial size=2>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.  </FONT></P>
    <P><FONT face=Arial size=2>I also moved the following two lines above the 
    "while" command:</FONT> </P>
    <P><FONT face=Arial size=2>$pct_used=int($pct_used);</FONT> <BR><FONT 
    face=Arial size=2>print STDOUT "size: " . $total . " MB Used:" . int($used) 
    . " MB (" . int($pct_used) . "%)\n";</FONT> </P>
    <P><FONT face=Arial size=2>and the screen output looks like this:</FONT> 
</P>
    <P><FONT face=Arial size=2>size  MB Used: 0  MB</FONT> </P><BR>
    <P><FONT face=Arial size=2>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.</FONT></P>
    <P><FONT face=Arial size=2>Thnaks very much for you time!</FONT> </P>
    <P><FONT face=Arial size=2>Ken Munson</FONT> <BR><FONT face=Arial 
    size=2>972.371.4779</FONT> <BR><FONT face=Arial 
    size=2>ken.munson@dalsemi.com</FONT> 
</P><BR></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>