Archived community.zenoss.org | full text search
Skip navigation
6660 Views 1 Reply Latest reply: Dec 29, 2011 10:18 AM by Nathan Harris RSS
racitup Rank: White Belt 11 posts since
Apr 20, 2010
Currently Being Moderated

Jun 15, 2010 10:38 AM

Using WMI Data Source in Reports

Hi all,

 

I've been searching the forums for a good example of how to use WMI query results using the WMI Data Source community plugin in a report and so far haven't found a good one, so maybe this can be the start of one...

 

I've found a few bits and pieces (interestingly both by Noel Brockett):

Creating Methods for Custom Reports

docs/DOC-2493

Retrieveing live external data via SNMP for a report

docs/DOC-3235

 

What I'm trying to do is list the number and type of sticks of RAM memory in a group of Windows 2003 servers in a report.

So far I've been able to get the information I need using a wmic command on a Windows Server command prompt:

wmic memorychip get /?
wmic memorychip get BankLabel,Capacity,Tag   ...

Using http://www.1e.com/techblog/post/2009/09/23/wmic-aliaswmi-class-mapping.aspx as a guide to getting the correct command.

And using http://msdn.microsoft.com/en-us/library/aa394347(v=VS.85).aspx as a guide to the Win32_PhysicalMemory Class.

 

So then was able to define a new zenoss data source on the /CIM/WMI device template using the query:

 

SELECT BankLabel, Capacity, Tag FROM Win32_PhysicalMemory

 

This seems to work as I can test it against a device and it gives an expected result.

And I think (!) adding a Data Point with the same name as the variable name makes it available to graphs and reports (is this correct?)

 

I have implemented a python script that runs the same code as the first link above and included it as a column in a custom report which works:

 

return ','.join([ s.name() for s in context.os.ipservices() if s.monitored() ])


But how do I modify it to get at the data from the new WMI data source?

 

Any hints are much appreciated!

 

Thanks,

Richard

  • Nathan Harris Rank: White Belt 62 posts since
    Mar 29, 2011
    Currently Being Moderated
    1. Dec 29, 2011 10:18 AM (in response to racitup)
    Re: Using WMI Data Source in Reports

    Hi Richard

     

    Hit similar dead end

     

    after creating a WMI Qury which graphs DiskWriteBytesPerSec in Zenoss

     

    SELECT DiskReadBytesPerSec,DiskWriteBytesPerSec FROM Win32_PerfRawData_PerfDisk_PhysicalDisk WHERE Name="_Total"

     

    I want to create a report to total the Bytes written in the day over a week and then over a month

     

    have you found a way to do this? or does anyone else have some ideas?

     

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points