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

Ken Munson Ken.Munson at dalsemi.com
Wed Aug 7 09:06:02 CEST 2002


> 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: <https://www.monitoring-plugins.org/archive/devel/attachments/20020807/d0b164e5/attachment.html>


More information about the Devel mailing list