Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


[HOWTO] Fetching WMI data from Linux
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Informational/HOWTO's
Author Message
djs



Joined: 09 Mar 2007
Posts: 2

PostPosted: Fri Mar 09, 2007 1:57 pm    Post subject: How to find latest version of HP WMI Mapper Reply with quote

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/server/us/revision/8220.html

/djs
Back to top
djs



Joined: 09 Mar 2007
Posts: 2

PostPosted: Mon Mar 12, 2007 1:41 pm    Post subject: single instance problem (SOLUTION) Reply with quote

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

PostPosted: Fri Mar 16, 2007 2:42 pm    Post subject: Reply with quote

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

PostPosted: Tue Mar 20, 2007 1:07 pm    Post subject: problems Reply with quote

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

PostPosted: Wed Mar 21, 2007 2:58 pm    Post subject: Reply with quote

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

PostPosted: Wed Mar 21, 2007 8:34 pm    Post subject: The Message Tracking Class was just an example... Reply with quote

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: 88

PostPosted: Fri Dec 07, 2007 12:41 pm    Post subject: Reply with quote

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

PostPosted: Thu Jan 03, 2008 1:55 pm    Post subject: Reply with quote

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: 88

PostPosted: Fri Jan 25, 2008 11:51 am    Post subject: Reply with quote

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

PostPosted: Fri Feb 29, 2008 7:34 am    Post subject: wbemcli Reply with quote

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

PostPosted: Tue May 20, 2008 4:58 am    Post subject: Need help creating a process remotely Reply with quote

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

PostPosted: Thu Jun 19, 2008 7:21 am    Post subject: Reply with quote

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: 17

PostPosted: Fri Aug 22, 2008 10:14 am    Post subject: Reply with quote

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/08/15/wmi-calls-from-linux/
Back to top
anx



Joined: 28 Apr 2007
Posts: 21
Location: Melbourne, Australia

PostPosted: Wed Aug 27, 2008 7:00 pm    Post subject: Reply with quote

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.



wmic.zip
 Description:
Centos 5 compile of wmi_0.1.13

Download
 Filename:  wmic.zip
 Filesize:  2.1 MB
 Downloaded:  96 Time(s)

Back to top
anx



Joined: 28 Apr 2007
Posts: 21
Location: Melbourne, Australia

PostPosted: Wed Aug 27, 2008 7:39 pm    Post subject: Reply with quote

I've posted a template using wmic here:

http://forums.cacti.net/viewtopic.php?p=143047
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Informational/HOWTO's All times are GMT - 5 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 



Powered by phpBB © 2001, 2005 phpBB Group