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

Tim Golden tim.golden at viacom-outdoor.co.uk
Tue Oct 26 15:57:47 CEST 2004


[Wyvern List]
| 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'm not sure I understand what's happening here. Is my understanding
of the scenario correct?

On machine A you can run some Nagios command on machine A
which indirectly runs diskfree.py on machine A, invoking WMI 
on machine A etc. This works.

On machine A you run some Nagios command on machine B
which indirectly runs diskfree.py on machine B, invoking WMI
on machine B. This gies some error.

In none of this are you trying to invoke WMI remotely.

Is this correct?

TJG

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


More information about the Python-win32 mailing list