<div><span class="q"><span class="gmail_quote">On 9/29/05, <b class="gmail_sendername">Luis Gardea</b> <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:gardealuis@gmail.com" target="_blank">gardealuis@gmail.com
</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi<br><br>I want see the service oracle in my nagios server, but I get the next error.<br><br>[root@netids
libexec]# ./check_oracle -tns <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://10.0.0.1/" target="_blank">10.0.0.1</a><br>Cannot determine ORACLE_HOME for sid <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://10.0.0.1/" target="_blank">
10.0.0.1</a><br><br>Could someone help me?</blockquote>
<div> </div></span>
<div>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.</div>
<div> </div>
<div>check_oracle uses the standard oracle client as available freely (although not in open source) from <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://oracle.com/" target="_blank">oracle.com</a>. 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
<font style="BACKGROUND-COLOR: #ffffb0" color="#000000">use</font> 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.
</div>
<div> </div>
<div>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.
</div>
<div> </div>
<div>But your problems do not end there, although at this point running the check manually from the console should work.</div>
<div> </div>
<div>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 :
<font size="2">ERROR OCIEnvNlsCreate (check ORACLE_HOME and NLS settings etc.).</font></div><br>Cheers,</div><span class="sg">
<div>Hans</div>
<div> </div></span>