<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi! <br>
<br>
Thanks for replying!<br>
<br>
Yes, i already did set up the shell environment properly (actually in
/etc/profile).<br>
I just did the test you adviced : user a shell script to launch the
python script. But it is exactly the same behaviour.<br>
<br>
i ask the program to display the environment variables (print
os.environ) : <br>
- when lauched from the command line, the python script (and the shell
script) returns me exactly the same variable than the shell. I can even
set up new variables (os.environ["TESTVAR2"]="blibli") and it display
fine.<br>
<br>
---- output ----<br>
{'LANG': 'fr_FR@euro', 'TERM': 'xterm', 'SHELL': '/bin/sh',
'ORACLE_HOME': '/opt/oracle/product/10.2.0/client_1', 'SHLVL': '2',
'ORACLE_BASE': '/opt/oracle', 'TESTVAR2': 'blibli', 'PWD':
'/home/www-data', 'LOGNAME': 'www-data', 'USER': 'www-data', 'MAIL':
'/var/mail/www-data', 'PATH':
'/opt:/usr/local/bin:/usr/bin:/bin:/usr/games:/opt/oracle/product/10.2.0/client_1/bin',
'HOME': '/home/www-data', 'LD_LIBRARY_PATH':
'/opt/oracle/product/10.2.0/client_1/lib', '_':
'/usr/local/nagios/libexec/dbRequest.py'}<br>
---------------<br>
You can even see the variable TESTVAR2 that i set in the python
script.....<br>
<br>
<br>
- when lauched from Nagios, the python script (and the shell script)
returns me this stuff :<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': '3956006', 'NAGIOS_SERVICEGROUPNAME':
'', 'NAGIOS_SERVICEACKCOMMENT': '', 'NAGIOS_DATE': '07-12-2008',
'NAGIOS_CONTACTPAGER': '', 'NAGIOS_HOSTACKAUTHOR': '',
'NAGIOS_RESOURCEFILE': '/usr/local/nagios/etc/resource.cfg',
'NAGIOS_LASTHOSTUNREACHABLE': '0', 'SHELL': '/bin/sh'</span><br>
<br>
I don't know where it gets that from....<br>
<br>
Wait!!!<br>
I just performed a test while writing. This confirm my fears...<br>
I just create a new command that just launch a shell script. The shell
script just echo an environment variable.<br>
when echoing $PATH, i get this frim nagios : <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;">/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin
<br>
<br>
</span>This is different than the shell environment PATH variable set
in /etc/profile :
PATH=/opt:/usr/local/bin:/usr/bin:/bin:/usr/games:/opt/oracle/product/10.2.0/client_1/bin<br>
<br>
The best : if i try to echo $ORACLE_HOME, guess what?..... "no
output"!!!!<br>
<br>
Those tests really show that some setting completely substitutes its
own environment variables to those from the shell.....<br>
<br>
<br>
WAIT AGAIN!!!!<br>
Amazing : if i restart the /etc/init.d/nagios then things go ok!<br>
But if i reboot the machine (/etc/init.d/nagios is in the runlevel
scripts) then it fails back!!!!<br>
<br>
There is really something going strange with nagios executing
environment!!!<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;"></span><br>
If you have any idea about it!!! I'll look in the init script if it has
something special....<br>
<br>
<pre class="moz-signature" cols="72">Guillaume 
</pre>
<br>
<br>
</body>
</html>