Monitoring Oracle
mark redding
mwjredding at gmail.com
Thu Dec 6 10:14:22 CET 2007
HI,
> I'm trying to monitoring oracle database and i need to know when the
> tablespaces is near of the limite determined in the database. I use
> oraDbTablespaceSizeAllocated and oraDbTablespaceSizeUsed to check this.
> Anyone knows how to use the value in oraDbTablespaceSizeAllocated to set the
> critical limit in the check_snmp plugin.
I use many scripts to report information out of a oracle database and
found the most flexible way to do this was to generate perl scripts to
interrogate the database and then have these scripts report nagios
codes back. I've used a custom command to achieve this (or if the
monitoring system is not able to execute oracle queries, then you
could use nrpe to remotely execute a script on a server that does have
oracle access) that is called via a service check.
For example :-
define command {
command_name logic_invoice_collection
command_line /home/nagios/bl/invoice/collection/query.pl "$ARG1$"
}
define service {
use bus-logic-service
host_name bb_logic
service_description INVCOLLECT
check_command logic_invoice_collection!30
}
Where query.pl looks something like this (the actual BB_BL subroutines
are not included as they are not relevant in the context of this
example) :-
#!/usr/bin/perl
use vars qw($PROGNAME);
use lib "/usr/local/nagios/libexec" ;
use utils qw (%ERRORS &print_revision &support);
my($inte) = $ARGV[0];
my $cur_count;
my $com_count;
$cur_count = BB_BL::doDatabaseRequest('INVCOLLECTCTRY',$inte);
$com_count = BB_BL::doDatabaseRequest('INVCOLLECTCTRY',$inte-3600);
my(%thresh) = BB_BL::grabThresholds();
my($status) = BB_BL::determineStatus($cur_count,$com_count,\%thresh);
my $description= "CURRENT : $cur_count / COMPARED : $com_count";
my($title) = "INVCOLLECT";
print $title . " " . $status . " - " . $description . "\n";
exit $ERRORS{$status};
The BB_BL::determineStatus subroutine returns
'OK','WARNING','CRITICAL' or 'UNKNOWN' and decides which value to
return based upon the different between two variables and their
relationship to some threshold values.
maybe this is of some help to you.
--
bright blessings,
Mark
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list