<!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.4807.2300" name=GENERATOR></HEAD>
<BODY>
<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></BODY></HTML>