|
|
| Author |
Message |
djs
Joined: 09 Mar 2007 Posts: 2
|
|
| Back to top |
|
 |
djs
Joined: 09 Mar 2007 Posts: 2
|
Posted: Mon Mar 12, 2007 1:41 pm Post subject: single instance problem (SOLUTION) |
|
|
ehall says above that you can't get the single instance, but 'You can just use the enumerate instance (ei) and achieve the same results, so this isn't a big deal really.'
See his post above where he talks about how you can't specify C:, etc., and look at the example that uses the 'ei' parameter to wbemcli command. You could use a little scripting wizardry to parse out the single instance info from the output of the 'ei' command (that returns the info for all the drives in this particular case).
/djs/
|
|
| Back to top |
|
 |
ostiguy
Joined: 16 Mar 2007 Posts: 2
|
Posted: Fri Mar 16, 2007 2:42 pm Post subject: |
|
|
Does anyone have a working script/config they can show me?
I can make things work from the command line, but when I enter that string as a data input method, it throws an error. I have written a shell script, and I get the same. Basically, I am really good at generating "output: U"s, and RRDs with NaN values.
03/16/2007 03:30:04 PM - CMDPHP: Poller[0] Host[2] CMD: cdrivefree.sh, output: U
My shell script is my working wbemcli invocation into a | tr -d '\n' because I thought the newline character was part of the problem, but probably is not.
|
|
| Back to top |
|
 |
Livio Zanol
Joined: 23 Feb 2006 Posts: 30
|
Posted: Tue Mar 20, 2007 1:07 pm Post subject: problems |
|
|
I have yet some doubts.
Where can I read about how to get the information on where to find the information that I want?
When must I use the ei,gc,gp,ri and ai functions?
I'm getting some serious problems on this...
Exmple: (Following ehall example):
After some search I've find the Exchange class, so I've made a little search, and used the gc (get class) function on this class:
| Code: | | ./wbemcli -nl gc 'http://DOMINIO\user:pass@maquina.f.q.d.n:5988/EXCHANGE/root/MicrosoftExchangeV2:Exchange_MessageTrackingEntry' |
And I've got some results:
| Code: |
-AttemptedPartnerServer
-Caption
-ClientIP
-ClientName
-Cost
(...)
|
Ok! But if i try to enumerate the instances (ei function or even ein) I've got error:
| Code: | ./wbemcli -nl ei 'http://DOMINIO\user:pass@maquina.f.q.d.n:5988/EXCHANGE/root/MicrosoftExchangeV2:Exchange_MessageTrackingEntry'
*
* ./wbemcli: Cim: (1) CIM_ERR_FAILED: A general error occurred that is not covered by a more specific error code: "[getInstanceEnum] general"
*
|
So I've tried all other functions and after see that the objects is PROPERTY type, I've also used the "gp" function withou success..
| Code: |
<PROPERTY NAME="AttemptedPartnerServer" TYPE="string">
</PROPERTY>
|
Where can I find information about how to make the WMI search sentences?
|
|
| Back to top |
|
 |
ostiguy
Joined: 16 Mar 2007 Posts: 2
|
Posted: Wed Mar 21, 2007 2:58 pm Post subject: |
|
|
Playing with scriptomatic , the exchange tracking log WMI stuff can spew damn near infinite amounts of information - it may spew back the entire contacts of all tracking logs. What are you trying to achieve with that object?
I am still getting nowhere with my problem - all U all the time
|
|
| Back to top |
|
 |
Livio Zanol
Joined: 23 Feb 2006 Posts: 30
|
Posted: Wed Mar 21, 2007 8:34 pm Post subject: The Message Tracking Class was just an example... |
|
|
The Message Tracking Class was just an example...
I want to know how to construct my query.
I've tried to use what ehall wrotes, but I was not sucessfull. When must I use the functions? (ei, gp, ai, ri, gc, ec, etc...)
Where can I find more information about the queries structure and the WMI classes?
|
|
| Back to top |
|
 |
llow Cacti User
Joined: 05 Oct 2007 Posts: 121
|
Posted: Fri Dec 07, 2007 12:41 pm Post subject: |
|
|
This is really just a windows question but I am trying to create a user with only read information for WMI but I get denied to LogonUser unless the user is an Administrator despite having the permissions set under the WMI tree.
Any help on this one?
|
|
| Back to top |
|
 |
juvann
Joined: 18 Dec 2006 Posts: 19
|
Posted: Thu Jan 03, 2008 1:55 pm Post subject: |
|
|
| llow wrote: | This is really just a windows question but I am trying to create a user with only read information for WMI but I get denied to LogonUser unless the user is an Administrator despite having the permissions set under the WMI tree.
Any help on this one? |
Sorry for the delay, I hope you have already resolved the problem.
I have a domain and all servers are joined to the domain I have created a user cacti group of Domain Users and for each server to monitor I have insert the user cacti in the local groups:
Distributed COM Users
Performance Log Users
In WMI Control - Security for the tree ROOT/CIMV2 the cacti user has the follow privileges:
- Execute Method
- Logon Accout
- Remote Enable
I hope is usefull.
|
|
| Back to top |
|
 |
llow Cacti User
Joined: 05 Oct 2007 Posts: 121
|
Posted: Fri Jan 25, 2008 11:51 am Post subject: |
|
|
Thanks but unfortunately I'm running Windows 2000 Server mostly. I'm not too worried about security because I have bigger problems if my monitoring servers get compromised.
I am, however, having a problem with cimv2:Win32_Service. Some services on some machines (seems random) show as State="Unknown" when they are running and I have not been able to figure it out. Any ideas?
|
|
| Back to top |
|
 |
cuph62
Joined: 29 Feb 2008 Posts: 2
|
Posted: Fri Feb 29, 2008 7:34 am Post subject: wbemcli |
|
|
Hey,
I am trying to use wmi_mapper as wmi_proxy together with wbemcli.
However requesting info form a qualified hostname or ip-address does not work :
eg :
::
/usr/bin/wbemcli -nl ei http://uid:pwd@hostname:5988/host.domain.com/root/cimv2:Win32_PerfFormat
and also the usage of an ipaddress
/usr/bin/wbemcli -nl ei http://uid:pwd@hostname:5988/10.16.8.212/root/cimv2:Win32_PerfFormat\
===
Both give me as result :
*
* /usr/bin/wbemcli: Http Exception: HTTP response code said error
*
Using a unqualified hostname works, but unfortunately this limits my requests severely..
I have tried to encode the dotted notations, but without sucess,
All tips appreciated
|
|
| Back to top |
|
 |
caprihan
Joined: 20 May 2008 Posts: 1
|
Posted: Tue May 20, 2008 4:58 am Post subject: Need help creating a process remotely |
|
|
Hi All,
Am a newbie to WMI Mapper...Have installed OpenPegasus on a Linux Box and am trying to create a notepad.exe process on my Windows XP based Laptop using the WMIMapper....Am getting CIM_ERR_FAILED exception when I try to invokeMethod by calling the Create method on the Win32_Process class on my Laptop.
Can anyone help out here? I have disabled HTTPS and am using HTTP. Can access restrictions be the problem?
Cheers,
Gaurav
|
|
| Back to top |
|
 |
nick.calvert
Joined: 19 Jun 2008 Posts: 1
|
Posted: Thu Jun 19, 2008 7:21 am Post subject: |
|
|
Hi guys,
I am trying to write a script to execute some very basic WMI methods from a linux machine. I have the mapper working fine and if I do:
wbemcli gc –nl 'http://administrator:password@domain:5988/root/virtualization:CIM_VirtualSystemManagementService'
I get a list of all the properties of that class – brilliant.
-Caption
-CreationClassName
-Description
-ElementName
-EnabledDefault
-EnabledState
-HealthState
-InstallDate
-Name
-OperationalStatus
-OtherEnabledState
-PrimaryOwnerContact
-PrimaryOwnerName
-RequestedState
-Started
-StartMode
-Status
-StatusDescriptions
-SystemCreationClassName
-SystemName
-TimeOfLastStateChange
Now I know there is a method called DefineVirtualSystem and if I get the wmi object under ruby and call the method with no parameters as “definevirtualsystem()” it creates a blank VM under HYPER-V.
If I do the following with wbemcli
wbemcli cm 'http://administrator:password!@domain:5988/root/virtualization:CIM_VirtualSystemManagementService DefineVirtualSystem.()'
I get the following error message: wbemcli: Parse Exception: Invalid name-value pair
http://msdn.microsoft.com/en-us/library/cc136786(VS.85).aspx this is the Technet page detailing the properties of that method, the important thing is I don’t want to pass any… How do I correct my syntax?
Cheers chaps!
|
|
| Back to top |
|
 |
felimwhiteley
Joined: 10 Dec 2007 Posts: 24
|
|
| Back to top |
|
 |
anx
Joined: 28 Apr 2007 Posts: 21 Location: Melbourne, Australia
|
Posted: Wed Aug 27, 2008 7:00 pm Post subject: |
|
|
I found it useful and have done some things with it. I think this is certainly the cleanest way to manage Windows machines from Linux and I know my Windows admins were not too keen about installing 3rd party tools like nsclient.
If you are running a recent Debian or Ubuntu, you just run:
| Code: | | sudo aptitude install wmi-client |
As lot of my clients run RedHat servers and as this is not in the RedHat network or any of the Centos repositories, I had to compiled it. Straight forward if you have a machine setup for development.
If you want to use my binary which was compiled on Centos 5, you can find it attached in a zip file.
If you want to compile it yourself, you can find the source on a debian mirror, for example: http://debian.cs.binghamton.edu/debian/pool/main/w/wmi/wmi_0.1.13.orig.tar.gz
Compile is using autotools, untar the source
| Code: | cd Samba/source
./autogen.sh
./configure
make proto bin/wmic |
If all goes well you will have a compiled wmic.
| Description: |
| Centos 5 compile of wmi_0.1.13 |
|
 Download |
| Filename: |
wmic.zip |
| Filesize: |
2.1 MB |
| Downloaded: |
177 Time(s) |
|
|
| Back to top |
|
 |
anx
Joined: 28 Apr 2007 Posts: 21 Location: Melbourne, Australia
|
|
| Back to top |
|
 |
|