Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with the first test provided #1

Open
davej0731 opened this issue Dec 6, 2013 · 3 comments
Open

Issues with the first test provided #1

davej0731 opened this issue Dec 6, 2013 · 3 comments

Comments

@davej0731
Copy link

Installed the wrapper client and sh for python.

After installation I just wanted to test the simple example you provided so I copied and pasted it into a python script, changing the parameters of username,password, and host.

When I go to execute it I get the following error:

[root@localhost smbtests]# python wmitest.py
Traceback (most recent call last):
File "wmitest.py", line 11, in
output = wmic.query("SELECT * FROM Win32_Processor")
File "/usr/lib/python2.6/site-packages/wmi_client_wrapper/wrapper.py", line 92, in query
output = sh.wmic(_arguments)
File "/usr/lib/python2.6/site-packages/sh.py", line 1721, in getattr
return self.env[name]
File "/usr/lib/python2.6/site-packages/sh.py", line 1660, in getitem
return Command._create(k, *_self.baked_args)
File "/usr/lib/python2.6/site-packages/sh.py", line 540, in _create
if not path: raise CommandNotFound(program)
sh.CommandNotFound: wmic

Am I missing another package?

Code:

!/usr/bin/python

import wmi_client_wrapper as wmi
import sh
import mock

wmic = wmi.WmiClientWrapper(
username="username",
password="password",
host="192.168.1.100",
)

output = wmic.query("SELECT * FROM Win32_Processor")

@kanzure
Copy link
Owner

kanzure commented Dec 6, 2013

You need to install wmic from the libwmiclient.git repository. There are
build instructions in that repository. Unfortunately
python-wmi-client-wrapper is not a pure-python implementation of wmic.
On Dec 6, 2013 2:10 PM, "davej0731" [email protected] wrote:

Installed the wrapper client and sh for python.

After installation I just wanted to test the simple example you provided
so I copied and pasted it into a python script, changing the parameters of
username,password, and host.

When I go to execute it I get the following error:

[root@localhost smbtests]# python wmitest.py
Traceback (most recent call last):
File "wmitest.py", line 11, in
output = wmic.query("SELECT * FROM Win32_Processor")
File "/usr/lib/python2.6/site-packages/wmi_client_wrapper/wrapper.py",
line 92, in query
output = sh.wmic(

_arguments) File "/usr/lib/python2.6/site-packages/sh.py", line 1721, in
getattr return self.env[name] File
"/usr/lib/python2.6/site-packages/sh.py", line 1660, in getitem return
Command._create(k, *_self.baked_args)
File "/usr/lib/python2.6/site-packages/sh.py", line 540, in _create
if not path: raise CommandNotFound(program)
sh.CommandNotFound: wmic

Am I missing another package?

Code:

#!/usr/bin/python
import wmi_client_wrapper as wmi
import sh
import mock

wmic = wmi.WmiClientWrapper(
username="username",
password="password",
host="192.168.1.100",
)

output = wmic.query("SELECT * FROM Win32_Processor")


Reply to this email directly or view it on GitHubhttps://github.com//issues/1
.

@davej0731
Copy link
Author

Understood, i had actually downloaded that but didn't compile/install it
yet, will do that now.

Thanks!

On Fri, Dec 6, 2013 at 2:11 PM, Bryan Bishop [email protected]:

You need to install wmic from the libwmiclient.git repository. There are
build instructions in that repository. Unfortunately
python-wmi-client-wrapper is not a pure-python implementation of wmic.
On Dec 6, 2013 2:10 PM, "davej0731" [email protected] wrote:

Installed the wrapper client and sh for python.

After installation I just wanted to test the simple example you provided
so I copied and pasted it into a python script, changing the parameters
of
username,password, and host.

When I go to execute it I get the following error:

[root@localhost smbtests]# python wmitest.py
Traceback (most recent call last):
File "wmitest.py", line 11, in
output = wmic.query("SELECT * FROM Win32_Processor")
File "/usr/lib/python2.6/site-packages/wmi_client_wrapper/wrapper.py",
line 92, in query
output = sh.wmic(

_arguments) File "/usr/lib/python2.6/site-packages/sh.py", line 1721, in
getattr return self.env[name] File
"/usr/lib/python2.6/site-packages/sh.py", line 1660, in getitem return
Command._create(k, *_self.baked_args)
File "/usr/lib/python2.6/site-packages/sh.py", line 540, in _create
if not path: raise CommandNotFound(program)
sh.CommandNotFound: wmic

Am I missing another package?

Code:

#!/usr/bin/python
import wmi_client_wrapper as wmi
import sh
import mock

wmic = wmi.WmiClientWrapper(
username="username",
password="password",
host="192.168.1.100",
)

output = wmic.query("SELECT * FROM Win32_Processor")


Reply to this email directly or view it on GitHub<
https://github.com/kanzure/python-wmi-client-wrapper/issues/1>
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-30025321
.

@Johnathon332
Copy link

I have compiled and installed the libwmiclient however am I still getting the same error as above. I am trying to run this on the raspberry pi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants