[python-win32] Can't import wmi in scripts run by nrpe_nt

Wyvern List wyvernlist at crm3.com
Tue Oct 26 01:29:46 CEST 2004


Hi all,

I'm having a curious problem and was wondering if anyone might have some
insight.

As a bit of background, nrpe_nt is a Nagios (www.nagios.org) addon. It
is a service that runs on Windows machines and allows nagios to execute
arbitrary scripts on that machine using the check_nrpe plugin.

When nagios calls nrpe_nt on a remote machine with a specific command to
execute, the nrpe_nt service maps the nagios command to a specific
command to be executed on the windows box. for example nrpe_nt might
have a definition to map the nagios command 'check_disk' to a command
such as "C:\Python23\python.exe C:\NRPE_NT\bin\DiskFree.py"

The aforementioned DiskFree.py is a simple python script I nabbed from
Tim Golden's "WMI Cookbook" that uses the wmi module. It works like a
charm when called locally, but when called by nrpe_nt the script bombs
out with the non-helpful message:

tombstone libexec # ./check_nrpe -H xxx.xxx.xxx.xxx -c check_python
Traceback (most recent call last):

I checked sys.path - it printed out the correct locations when run by
nrpe_nt. I tried using the imp module to do some more debugging, and
found that python could find the wmi module, but it bombed when I tried
to load it using load_module.

I tried it with ActivePython but got the same problem. Could this be
related to the WMI multithreading issue?

Thanks,

Jan

---
Jan Van Uytven
Computer Systems & Network Engineer
Convergent Media Network
wyvern at crm3.com

Randomly selected from my quote-file:

"I smell blood and an
           era of prominent madmen."
                     -W.H. Auden


>>> LEGAL STUFF <<< 
This electronic message transmission, including any attached files, 
contains information which may be confidential and/or privileged.
The information is intended to be for the SOLE use of the individual or 
entity named above. If you are not the intended recipient, be aware 
that any review, disclosure, copying, distribution or use of the 
contents of this information is prohibited. This message is not to be 
forwarded for any reason without prior consent of the sender. 

If you have received this electronic transmission in error, please 
notify the sender immediately by telephone (250) 386-4266 or by a 
'reply to sender only' message and destroy all electronic and hard 
copies of the communication, including attachments, without reading 
or saving in any manner.



More information about the Python-win32 mailing list