Maultiple Oracle SID's


#1

I have a main Nagios server that i monitor 12 other servers that run Oracle. To monitor the table spaces i use NRPE to run the check_oracle plugin and report back to the nagios server. I do this because when i set $ORACLE_SID on the nagios server im under the impression only one can be set, but i use different ORACLE_SIDS for each server.

Can more than one ORACLE_SID be defined on the nagios monitoring server so i can stop using NRPE to monitor the tables spaces on all of them? BTW i only have instant client installed on the Nagios server. Full oracle is on the db servers them selves.

Thanks!


#2

Create config file for your custom command definitions in ***/etc/nagios-plugins/config/***, name it whatever you wish, for example, my_comm_defs.cfg and in there you should create command definition. As an example how to do that view other files in that directory and copy paste one command definition to your my_comm_defs.cfg, and, of course, change the command_line variable to check_oracle, and take care of the path to your check_oracle plugin. It should look something like this:

define command{ command_name check_my_oracle command_line /usr/lib/nagios/plugins/check_oracle <OPTION> $ARG1$ $ARG2$ $ARGn$ }
Those $ARG#$ thingies are here just for example and those are the arguments which you would like to use.
Check the available options and arguments by starting the plugin check_oracle form terminal like this:

and see which one suits best for your needs. If you need only one then in command definition you will put only one $ARG1$

Then when creating a service which would check oracle, for check_command you should put the command_name of the command with arguments (in your case SID, I’ll take the argument is my_SID) delimited by !
Like this:

Hoep it solves your problem.


#3

Here is the problem. I use a file called commands.cfg and my entry in there is:

define command{
command_name check_oracle_login
command_line $USER1$/check_oracle_ns --login $ARG1$
}

In my services.cfg i use:

define service{
use generic-service-long
host_name db server
service_description Oracle login
check_command check_oracle_login!oracle_sid
}

Without setting the $ORACLE_SID on the nagios server i get Cannot determine ORACLE_HOME for sid name of dbserver

So i cant set more than one ORACLE_HOME for the user nagios. If i can, please let me know.


#4

I haven’t personally tested it, but it seems that check_oracle is NRPE plugin. I’m not sure it could be configured without NRPE, but check that on other discussions about this issue. Google around the check_oracle

Interesting topic about the issue:
[http://www.mail-archive.com/nagios-users@lists.sourceforge.net/msg05446.html](hyperlink url)
other thingies:
[http://www.itefix.no/i2/node/9](hyperlink url)
[http://osdir.com/ml/network.nagios.plugins/2005-07/msg00045.html](hyperlink url)

…and one topic on this forum about the issue:
[http://www.meulie.net/portal_plugins/forum/forum_viewtopic.php?11028](hyperlink url)


#5

no it can be used without nrpe, we do it on another Nagios server with only one SID.