Welcome to the ZenPack SDK!
The ZenPack SDK is a collection of development tools and documentation that you can use to extend Zenoss’ functionality.
ZenPacks are a plugin mechanism for Zenoss. Most commonly they’re used to extend Zenoss to monitor new types of targets. We developed zenpacklib to simplify the process of creating custom ZenPacks.
What is zenpacklib?
zenpacklib is a Python library that makes building common types of ZenPacks simpler, faster, more consistent, and more accurate.
What does zenpacklib do?
Specifically zenpacklib allows all of the following to be described in YAML, and extended in Python only if necessary.
- zProperties (a.k.a. Configuration Properties)
- Device Classes
- Monitoring Templates
- New Device and Component Types
- Relationships between Device and Component Types
- Event Classes
- Process Classes
- Device Link Providers
- Impact Triggers
It is this combination of declarative YAML and imperative Python extension that allows zenpacklib to make easy things easy and hard things possible.
Who should use zenpacklib?
You should consider using zenpacklib if any of the following statements apply to you.
- Your ZenPack will only contain monitoring templates, but you prefer creating YAML files over creating monitoring templates by clicking around the Zenoss web interface.
- Your ZenPack needs to add zProperties.
- Your ZenPack needs to add new device or component types and relationships between them.
You should even consider using zenpacklib if you are an experience ZenPack developer and already know how to create new device and component types. You will find that the amount of boilerplate code you need to write is drastically reduced, if not eliminated, by using zenpacklib. You will still have all of the power of Python to extend upon the functionality provided by zenpacklib.
If your ZenPack only consists of configuration you can create and add to a ZenPack using the Zenoss web interface, and you’re more comfortable clicking through the web interface than create a YAML file, you probably should use Zenoss’ built-in capabilities instead of zenpacklib.
What about some examples?
The following example shows an example of adding new zProperties. Note the special DEFAULTS entry. You’ll find that this is supported in many places as a way to set default properties for all other entries in a section. In this case it will set category to ACME Widgeter for the zWidgeterEnable and zWidgeterInterval zProperties.
Extending upon that example we can add a device class and monitoring template complete with a datasource, threshold and graph.
Finally we can add a new device type, component type and relationship between them.
Next we will learn how to setup a productive Development Environment.