######################################################################
# Copyright (c) 2000 Trivadis AG, Schweiz
# Copyright (c) 2000 Philip Markwalder  Philip.Markwalder@trivadis.com
# Desc: Big Sister Modul to check oracle databases
#######################################################################

my $oracle;

# For debugging issues
if( $BigSister::common::dl>1 )
{
   print "ORACLE_MODULE: LOADING ... !!!\n";
}       

# check if modules is loaded, else load
unless ( $oracle = $memory{"oracle_$args{frequency}"} ) 
{
	# load module if not loaded
	&uxmon::load_module( "oracle" );
	# initialize object for service "oracle"
	&uxmon::checker( 
		$memory{"oracle_$args{frequency}"} = $oracle = Monitor::oracle->new( 30 )
	);
	
	$oracle->sched_frequency( $args{"frequency"} );
};

# print if debugging is enabled
print "ORACLE_MODULE: starting check ... " if ( $BigSister::common::dl>3 );

$args{ORACLE_NLS_LANG}="american_america.WE8ISO8859P1" if ( ! defined( $args{ORACLE_NLS_LANG} ) );
$args{ORACLE_NLS33}   =$args{ORACLE_HOME} . "/ocommon/nls/admin/data" if ( ! defined( $args{ORACLE_NLS33} ) );

# send parameters to the check
$oracle->add_check($args{"alias"},$args{ORACLE_CONNECT},$args{ORACLE_BASE},$args{ORACLE_HOME},$args{ORACLE_NLS_LANG},$args{ORACLE_NLS33},$args{ORACLE_TNSADMIN},$args{ORA_USER},$args{ORA_PASS});
	
# if we're in debugging mode, print message saying where we're at
if( $BigSister::common::dl>1 )
{
    print "ORACLE_MODULE: Made it through Config, anyway ...\n";
}                                                              

1;
