[Nagiosplug-help] check_oracle plug in help

Vonnahme, Nathan nathan.vonnahme at bannerhealth.com
Tue May 20 20:54:25 CEST 2008


Shankar,

Looking at my stuff, it looks like I have an older version of Nagios (2.0b3) and plugins (1.4.2), and am using the Perl 'check_oracle_instance.pl' script in the contrib/ directory rather than the check_oracle binary.  I'm sure I had to get the Perl DBD::Oracle module working for it (I used the instant client for Linux; let me know off list if you have trouble with that part and I can probably help you).  I think it will work the same with modern Nagios and plugins though.

>From the command line, I run it like something like this (on the Nagios host, not the oracle host):

	check_oracle_instance.pl -t -c host=oracle_host;sid=oracle_instance_sid -u username -p password -t89/94


Once you have that working you can put it all in config files, with a workaround for the semicolon.  Here's what I have in mine:

In *resource.cfg*:

	$USER9$=;


In *misccommands.cfg*:

# $USER9$ is set to a semicolon in order to make this work-
#     -c host=fai02020;sid=FOO1
# an alternate (better?) way would be to specify the -c string like //host:port/sid,
# e.g.
#    -c //fai02020/FOO1
#    -c //$HOSTNAME$/$ARG1$

define command{
        command_name    check_oracle_instance
        command_line    $USER1$/contrib/check_oracle_instance.pl -t -c host=$HOSTNAME$$USER9$sid=$ARG1$ -u $ARG2$ -p $ARG3$ $ARG4$
}



In *services.cfg*, something like this:


define service {     ; stuff common to prod and nonprod
        name                              oracle-service
        use                               generic-service
        register                          0       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
        contact_groups                    oracle-admins, oracle-mobile
}
define service {
        name                               oracle-nonprod-service
        use                                oracle-service
        register                           0       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
	; more non-prod specific stuff here
}

## FOO database
define service{
        service_description             FOO Oracle primary instance
        use                             oracle-nonprod-service
        servicegroups                   FOO
        host_name                       oraclehost1
        check_command                   check_oracle_instance!FOO1!username!password!-a99/999
}
define service{
        service_description             FOO Oracle can extend
        use                             oracle-nonprod-service
        servicegroups                   FOO
        host_name                       oraclehost1
        check_command                   check_oracle_instance!FOO1!username!password!-x
}
define service{
        service_description             FOO Oracle tablespace
        use                             oracle-nonprod-service
        host_name                       oraclehost1
        servicegroups                   FOO
# don't notify on 'warning' status
        notification_options            c,r
        check_command                   check_oracle_instance!FOO1!username!password!-t92/99
}





---------------------------------
From: asam30 at gmail.com [mailto:asam30 at gmail.com] 
Sent: Tuesday, May 20, 2008 2:13 AM
To: Vonnahme, Nathan
Subject: Re: [Nagiosplug-help] {Disarmed} RE: {Disarmed} Re: {Disarmed} RE: {Disarmed} check_oracle plug in help

Nathan,
 
Is there any way we can run check_oracle without the nrpe daemon on the remote host?
 
Can you tell me how you accomplish this task?
 
I was on almost a week spending my time to fix this issue. I would like to run 
 
check_oracle --tns
check_oracle --tablespace
 
from nagios host?
 
Please help me in this regard
 
Thanks
-Shankar
On Fri, May 16, 2008 at 2:15 AM, Vonnahme, Nathan <nathan.vonnahme at bannerhealth.com> wrote:
Shankar,

I use the check_oracle plugin, but I run it from the Nagios host instead
of the Oracle hosts, so NRPE is not in the picture in my case.  That
might be a valid workaround for you.

-n






More information about the Help mailing list