[HOWTO] Fetching WMI data from Linux
Moderators: Developers, Moderators
How to find latest version of HP WMI Mapper
To download the latest version of the HP WMI Mapper tool, use the link to the revision history document for the download.:
http://h18023.www1.hp.com/support/files ... /8220.html
/djs
http://h18023.www1.hp.com/support/files ... /8220.html
/djs
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/
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/
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.
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.
-
- Posts: 37
- Joined: Thu Feb 23, 2006 5:59 pm
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:
And I've got some results:
Ok! But if i try to enumerate the instances (ei function or even ein) I've got error:
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..
Where can I find information about how to make the WMI search sentences?
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: Select all
./wbemcli -nl gc 'http://DOMINIO\user:pass@maquina.f.q.d.n:5988/EXCHANGE/root/MicrosoftExchangeV2:Exchange_MessageTrackingEntry'
Code: Select all
-AttemptedPartnerServer
-Caption
-ClientIP
-ClientName
-Cost
(...)
Code: Select all
./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"
*
Code: Select all
<PROPERTY NAME="AttemptedPartnerServer" TYPE="string">
</PROPERTY>
-
- Posts: 37
- Joined: Thu Feb 23, 2006 5:59 pm
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?
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?
Sorry for the delay, I hope you have already resolved the problem.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?
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.
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?
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?
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.domai ... PerfFormat
and also the usage of an ipaddress
/usr/bin/wbemcli -nl ei http://uid:pwd@hostname:5988/10.16.8.21 ... 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
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.domai ... PerfFormat
and also the usage of an ipaddress
/usr/bin/wbemcli -nl ei http://uid:pwd@hostname:5988/10.16.8.21 ... 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
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
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
-
- Posts: 2
- Joined: Thu Jun 19, 2008 7:12 am
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:59 ... entService'
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:5 ... entService DefineVirtualSystem.()'
I get the following error message: wbemcli: Parse Exception: Invalid name-value pair
http://msdn.microsoft.com/en-us/library ... S.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!
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:59 ... entService'
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:5 ... entService DefineVirtualSystem.()'
I get the following error message: wbemcli: Parse Exception: Invalid name-value pair
http://msdn.microsoft.com/en-us/library ... S.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!
-
- Posts: 26
- Joined: Mon Dec 10, 2007 10:14 am
There's also a wmiclient available which is in Ubuntu/Debian. I've got a post about this if anyone finds it useful.
http://felimwhiteley.wordpress.com/2008 ... rom-linux/
http://felimwhiteley.wordpress.com/2008 ... rom-linux/
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:
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/ ... rig.tar.gz
Compile is using autotools, untar the source
If all goes well you will have a compiled wmic.
If you are running a recent Debian or Ubuntu, you just run:
Code: Select all
sudo aptitude install wmi-client
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/ ... rig.tar.gz
Compile is using autotools, untar the source
Code: Select all
cd Samba/source
./autogen.sh
./configure
make proto bin/wmic
- Attachments
-
- wmic.zip
- Centos 5 compile of wmi_0.1.13
- (2.1 MiB) Downloaded 4288 times
Who is online
Users browsing this forum: No registered users and 2 guests