Problem with check_oracle

Hans Engelen engelenh at gmail.com
Fri Sep 30 15:12:28 CEST 2005


On 9/29/05, Luis Gardea <gardealuis at gmail.com> wrote:
>
> Hi
>
> I want see the service oracle in my nagios server, but I get the next
> error.
>
> [root at netids libexec]# ./check_oracle -tns 10.0.0.1 <http://10.0.0.1/>
> Cannot determine ORACLE_HOME for sid 10.0.0.1 <http://10.0.0.1/>
>
> Could someone help me?

 I think you are getting the wrong idea about how the plugin works, and for
that matter how the underlying oracle layer works. Let me roughly explain
it.
 check_oracle uses the standard oracle client as available freely (although
not in open source) from oracle.com <http://oracle.com/>. In effect it uses
the sqlplus client executable and captures the output (last time i checked).
As such you need to have the oracle client installed and properly set up.
This means having also set up the TNS names for the databases you are going
to use in the tnsnames.ora file. This last file is located in the
$ORACLE_HOME/network/admin directory. A sample file is provided upon install
of the oracle client but some affinity and knowledge will be needed still.
Then again you need a similar file on all your normal oracle clients anyway,
wether server or workstation. So it has to be available in your environment
somewhere or nobody could communicate with the Oracle DB.
 Also needed are a number of environment variables. And this is where the
plot thickens, substantially. One of the environments you need is
$ORACLE_HOME, the value for this is simple since it points to your directory
where you installed the Oracle Client. Others you might need are
$ORACLE_USER and $ORACLE_SID. The first is the owner (who has to be non-root
as requested by the oracle installer) of the oracle client. Usually oracle
(although I had to take apache for my nagios install, I had some serious
permission problems post client install and decided in the end to abuse the
apache user for that and work around the problems I had). The second
parameter is the SID of your default Oracla Database. This does not prevent
you from using other databases but just gives you a default setting to fall
back to if you do not explicitly define it. My advice is to definitly set
these variables up by default in your /etc/profile or ~/.bash_profile at the
very least.
 But your problems do not end there, although at this point running the
check manually from the console should work.
 The biggest problem I have had with check_oracle however is when it is run
by the Nagios process. I have found this bit to be extremely cumbersome on
my setup. I kept getting errormessages about the client not being able to
set up the NLS environment which ... quite frankly proved to be a serious
problem to tackle. Best I can figure it has something to do with the
NLS_LANG (or was it LANG) environment variable and others not being properly
setup (in fact I suspect no environment variables get set) when run via
Nagios. I never did find a clear answer to it and it is just sheer luck that
I managed to fix it (just don't ask me how it was a 3 day session of trial
and error). What I couldn't figure out is all the references on the web
regarding this issue seem to point toward mod_perl2. I am talking here about
the infamous : ERROR OCIEnvNlsCreate (check ORACLE_HOME and NLS settings
etc.).

Cheers,
Hans
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050930/dcba0652/attachment.html>


More information about the Users mailing list