Difference between revisions of "ZenPack:WBEM"

From Zenoss Wiki
Jump to: navigation, search
m
m
Line 11: Line 11:
 
|Compatible with=Zenoss Core 4.2.x, Zenoss Resource Manager 4.1.x, Zenoss Resource Manager 4.2.x
 
|Compatible with=Zenoss Core 4.2.x, Zenoss Resource Manager 4.1.x, Zenoss Resource Manager 4.2.x
 
|Requires=PythonCollector
 
|Requires=PythonCollector
|Flavor=core
 
 
}}
 
}}
 
|Devices=
 
|Devices=
 
|Applications=
 
|Applications=
 
|Binaries=
 
|Binaries=
 +
|Flavor=core
 
}}
 
}}
 
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.
 
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.

Revision as of 12:30, 11 April 2013

Note: This is a Core ZenPack which can be found in the Core Zenoss RPM, and is fully documented in the Zenoss Extended Monitoring Guide. If you did not install this pack when you installed Zenoss Core, it can be found in $ZENHOME/packs.

Current Maintainer(s)
Zenoss,Inc.
Organization
Zenoss, Inc.
ZenPack name
ZenPacks.zenoss.WBEM
Git sources (for cloning)
Link




WBEM ZenPack

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

Warning

The ZenPack Catalog has moved to its new home at https://www.zenoss.com/product/zenpacks as of January 17, 2017. The following information may be out of date, and this page will eventually be removed.

Support

This ZenPack is part of Zenoss Core. Open Source users receive community support for this ZenPack via our online forums. Enterprise support for this ZenPack is provided to Zenoss customers with an active subscription.

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

Discuss

Purplemarker.png New: Don't forget to add yourself to the Zenoss User Map!

blog comments powered by Disqus