Difference between revisions of "ZenPack:WBEM"

From Zenoss Wiki
Jump to: navigation, search
(Add 2.1.0 release.)
 
Line 6: Line 6:
 
|Source URI=git://github.com/zenoss/ZenPacks.zenoss.WBEM.git
 
|Source URI=git://github.com/zenoss/ZenPacks.zenoss.WBEM.git
 
|Releases={{Release
 
|Releases={{Release
 +
|Version=3.0.0
 +
|Tag=3.0.0
 +
|Release date=2019/08/15
 +
|Summary=Updated to use the lastest versions of pywbem and M2Crypto libraries for compatibility with SSL/TLS on modern devices.
 +
|Compatible with=Zenoss Core 5.1.x, Zenoss Resource Manager 5.x.x
 +
}}{{Release
 
|Version=2.1.0
 
|Version=2.1.0
 
|Tag=2.1.0
 
|Tag=2.1.0

Latest revision as of 23:55, 15 August 2019

Current Maintainer(s)
Zenoss,Inc.
Organization
Zenoss, Inc.
License
GNU General Public License, Version 2, or later
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 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 3.0.0- Download
Summary of changes: Updated to use the lastest versions of pywbem and M2Crypto libraries for compatibility with SSL/TLS on modern devices.
Released on 2019/08/15
Compatible with Zenoss Core 5.1.x, Zenoss Resource Manager 5.x.x
Version 2.1.0- Download
Released on 2018/09/26
Requires PythonCollector ZenPack
Compatible with Zenoss Core 4.2.x, Zenoss Resource Manager 4.2.x, Zenoss Resource Manager 5.x.x
Version 2.0.1- Download
Released on 2018/05/15
Requires PythonCollector ZenPack
Compatible with Zenoss Core 4.2.x, Zenoss Core 5.0.x, Zenoss Core 5.1.x, Zenoss Resource Manager 4.2.x, Zenoss Resource Manager 5.0.x, Zenoss Resource Manager 5.1.x, Zenoss Resource Manager 5.x.x
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

Discuss

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

blog comments powered by Disqus