<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hello!<br>
<br>
first of all, please forgive me for my writing as English is not my
native language.<br>
<br>
I have successfully written and integrated some plugins for Nagios (all
written in Python).<br>
I do appreciate Nagios for the liberty to write you own plugin.<br>
But i get stuck with the last one....<br>
<br>
This plugin is aimed to query databases and return some values (perf
(SGA...) & fonctionnal (nb users connected...)).<br>
It's written in Python and uses the cx_Oracle module to communicate
with Oracle DB's.<br>
<br>
OK, let's go to the point!<br>
The plugin executes perfectly from the command line.<br>
However, after being integrated to nagios ans executed within nagios
environment, it fails to execute.<br>
<br>
This is NOT a 'no output' error.<br>
After debugging it appear the it can't load properly the cx_Oracle
module because it does not find some files.<br>
Indeed, cx_Oracle module does need some particuliar environment
variables (those for the Oracle client access suite) : ORACLE_HOME,
LD_LIBRARY_PATH and so on...<br>
<br>
While debugging, it appears that the environment variables within the
execution environment of nagios are very different from the shell's
variables.<br>
That is quite normal as when i execute the python script through the
shell, it's a son process and it inherit from the shell's environment
variables (which are properly set).<br>
But when executed from Nagios, the environment variables are those :<br>
-----<br>
<span class="Apple-style-span"
 style="border-collapse: separate; color: rgb(82, 82, 82); font-family: Verdana; font-size: 9px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">{'NAGIOS_SERVICEDOWNTIME':
'0', 'NAGIOS_HOSTDURATIONSEC': '3645892', 'NAGIOS_SERVICEGROUPNAME':
'', 'NAGIOS_SERVICEACKCOMMENT': '', 'NAGIOS_DATE': '03-12-2008',
'NAGIOS_CONTACTPAGER': '', 'NAGIOS_HOSTACKAUTHOR': '',
'NAGIOS_RESOURCEFILE': '/usr/local/nagios/etc/resource.cfg',
'NAGIOS_LASTHOSTUNREACHABLE': '0', 'SHELL': '/bin/sh'</span><br>
----<br>
<br>
So, finally, my question is :<br>
Where can i set the nagios executing environment variables in order to
load my module properly??????????????<br>
<br>
I have looked for it through the Web, but i definitely get stuck....<br>
<br>
If you have any idea about it, i would really appreciate!!!!<br>
<br>
<pre class="moz-signature" cols="72">-- 
Guillaume
</pre>
</body>
</html>