root/trunk/wmi/README

Revision 7089, 3.1 kB (checked in by ahajda, 14 months ago)
testing svn perms
Line 
1DCOM/WMI client implementation for Linux.
2    andrzej.hajda@wp.pl, 2006-2007
3
4ABOUT
5
6This implementation of DCOM/WMI client is based on Samba4 sources.
7It uses RPC/DCOM mechanism to interact with WMI services on
8Windows 2000/XP/2003 machines.
9It contains also winexe - program to remote execution Windows commands remotely from Linux box.
10Additional info about winexe at http://eol.ovh.org/winexe/.
11
12REQUIREMENTS
13
14The same as for Samba (gcc ???, autoconf ???).
15For python bindings:
16 - SWIG >= 1.3 (I am using version 1.3.25).
17 - Python >= 2.3.
18For winexe:
19 - crossmingw32-binutils
20 - crossmingw32-gcc
21 - crossmingw32-gcc-c++
22 - crossmingw32-w32api
23
24
25COMPILATION
26
27Simple steps(change python path if necessary):
28$ cd Samba/source
29$ ./autogen.sh
30$ CPPFLAGS="-I/usr/include/python2.4" ./configure
31$ make proto bin/wmic bin/wmis wmi/_pywmi.so bin/winexe
32
33BUILDING ON MAC
34
35$ cd Samba/source
36$ ./autogen.sh
37$ CPPFLAGS="-I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/" ./configure
38$ make proto bin/wmic bin/wmis wmi/_pywmi.dylib bin/winexe
39
40
41For details check Samba documentation in Samba/howto.txt.
42
43INSTALLATION
44
45Currently there is no install procedure. Generated binaries are located
46in Samba/source:
47  bin/wmic - WMI simple client, it queries server using ExecQuery WMI method,
48         sample usage:
49            wmic -U domain/user%password //host "select Name from Win32_Process"
50         Program is at early stage of development and there are many bugs.
51         To retrieve more debug info use switch "-d number", where bigger number
52         corresponds to bigger output (I am using "-d 99" :) )
53  bin/wmis - WMI test suite. Currently it does only following things:
54        - Creates directory remotely using Win32_Process.Create("cmd.exe /C mkdir C:\wmi_test_dir_tmp").
55        - Executes ExecNotificationQuery for monitoring file create/delete events in this directory.
56        - Waits for 4 notifications and display their types.
57  wmi/_pywmi.so - Samba wrapper for python, together with wmi/pywmi.py and ../pycom/* modules can be used
58        to run zenwin on Linux.
59  bin/winexe - Remote windows commands execution.
60        Sample usage:
61            winexe -U domain/user%password //192.168.0.3 "ipconfig /all"
62
63PYTHON MODULES (early stage, experimental, for zenwin)
64
65There are two locations of python modules required to run zenwin:
66- ./pycom - modules providing api of pywin32 library used in zenwin.
67- ./Samba/source/wmi - SWIG generated Samba binding modules (pywmi.py, _pywmi.so), used by ./pycom.
68To run zenwin you should:
690. Compile _pywmi.so module, see COMPILATION section.
701. Download zenwin: svn co http://dev.zenoss.org/svn/trunk/zenwin.
712. Edit zenwin config files if necessary.
723. Configure/run zenoss.
734. Run zenwin components, with properly set env variable PYTHONPATH, for example in bash/sh:
74cd $ZENWINPATH
75PYTHONPATH="$WMIPATH/pycom:$WMIPATH/Samba/source/wmi" python ./$PROG.py -C etc/$PROG.cfg -v 10 --cycle=5
76where:
77    ZENWINPATH - path to zenwin directory
78    WMIPATH - path to wmi directory
79    PROG - one of zenwin components (zenwin, zenwinmodeler, zeneventlog)
80
81TODO
82
83- Implement handling of all CIM types,
84- Free unused memory,
85- Release DCOM objects
86
87General:
88- Create async version
Note: See TracBrowser for help on using the browser.