ZenPacks

WBEM ZenPack

Adds a WBEM data source type and a WBEMPlugin base modeler plugin.

Support

This is an Open Source ZenPack developed by Zenoss, Inc. Enterprise support for this ZenPack is available to commercial customers with an active subscription.

Releases

Version 1.0.3- Download
Released on 2015/09/11
Requires PythonCollector ZenPack
Compatible with Zenoss Core 4.2.x, Zenoss Core 5.0.x, Zenoss Resource Manager 4.2.x, Zenoss Resource Manager 5.x.x

Background

This ZenPack provides a new WBEM data source type that makes it easy to collect metrics from a WBEM provider using a CQL query. It also provides a new WBEMPlugin modeler plugin base class that simplifies modeling devices and applications that support WBEM.

WBEM Data Source Type

The WBEM data source type added by this ZenPack allows you to add a WBEM data source with the following new new data source properties.

Namespace
The WBEM namespace. This must be specified and there is no default value. A common example would be root/cimv2.
CQL Query
The CQL query to execute that will return the desired record(s). This must be specified and there is no default value.
Result Component Key
Optional. Only used in cases where the WBEM data source is in a monitoring template that gets bound to components. In this case Result Component Key should be set to the attribute or column name that contains the component identifier in the result set of the CQL Query.
Result Component Value
Optional. Only used in cases where the WBEM data source is in a monitoring template that gets bound to components. In this case Result Component Value is the value that gets mapped to values in the Result Component Key column of the CQL result set. Typically this takes the form of a TALES expression such as ${here/id} or ${here/wbemInstanceId} if wbemInstanceID was modeled on your component.
Result Timestamp Key
Optional. Used in both device- and component-bound monitoring templates when the query result set has a column noting the time the data was originally collected. Like the Result Component Key this should be the name of an attribute or column name in the results. By default this will default to NOW as the collection time.

WBEMPlugin Modeler Plugin Base Class

The WBEMPlugin modeler plugin base class allows you to create modeler plugins that do something with data that is returned from a WBEM EnumerateInstances call.

See the following example of a modeler plugin.

from ZenPacks.zenoss.WBEM.modeler.wbem import WBEMPlugin
from ZenPacks.zenoss.WBEM.utils import result_errmsg
 
"""Description of what MyWBEMPlugin does."""
 
 
class MyWBEMPlugin(WBEMPlugin):
    wbemQueries = {
        # EnumerateInstances (ei) for all EMC arrays.
        'root/emc:EMC_ArrayChassis': 'ei',
        }
 
    def process(self, device, results, log):
        log.info('Modeler %s processing data for device %s',
            self.name(), device.id)
 
        for success, instances in results:
            if not success:
                log.warn("WBEM: %s %s", device.id, result_errmsg(instances))
                continue
 
            # Check for no instances in results.
            if len(instances) < 1:
                continue
 
            # classname will become EMC_ArrayChassis.
            classname = instances[0].classname
 
            if classname == 'EMC_ArrayProduct':
                return self.objectMap(compname='hw', data={
                    'serialNumber': instance['SerialNumber'],
                    'setProductKey': MultiArgs(instance['Model'], instance['Manufacturer']),
                    })

Installation

Normal Installation (packaged egg)

  1. Download the appropriate egg file for the version of Zenoss you are running.
  2. Ensure you are logged in as the zenoss user:
    $ sudo su - zenoss
  3. Install the ZenPack:
    $ zenpack --install ZenPacks.zenoss.WBEM-*.egg
  4. Restart these services:
    $ zenoss restart

Developer Mode Installation

In order to do a development mode installation you will want to clone the existing git repository, and then use the --link flag with the zenpack command:

  1. Ensure you are logged in as the zenoss user:
    $ sudo su - zenoss
  2. Start by cloning the upstream repository:
    $ git clone git://github.com/zenoss/ZenPacks.zenoss.WBEM.git
  3. Next, perform the installation:
    $ zenpack --link --install ZenPacks.zenoss.WBEM
  4. Finally, restart these serivices:
    $ zenoss restart

Open Source

This ZenPack is developed and supported by Zenoss Inc. Contact Zenoss to request more information regarding this or any other ZenPacks. Click here to view all available Zenoss Open Source ZenPacks.