Attention current and would-be ZenPack developers. If you're anything like me, you prefer to learn by example. While there exists a large library of open source ZenPacks both from Zenoss and the community, it can often be difficult to find an example that demonstrates what you're trying to do.
To this end I have created a new project called ZenPackTemplate. You can find this project on GitHub at http://github.com/zenoss/ZenPackTemplate. Rather than write comprehensive documentation on everything you could do with a ZenPack, I've created a template that can be used as a starting point for building a new ZenPack. In fact, when Zenoss 4.1 is released it will be the new skeleton that's put in place when you create a new ZenPack from the web interface.
If you want to have this template used automatically for your new ZenPacks, follow these steps on your Zenoss master server.
mv ZenPackTemplate ZenPackTemplate.old
git clone git://github.com/zenoss/ZenPackTemplate.git
Alternatively you can browser the repository to see some common ZenPack techniques.
All of the example code is compatible with Zenoss versions 3.1 through 4.1 unless otherwise noted below.
Example are provided for the following.
- Directory structure and file location requirements and conventions.
- Extending the object model.
- API implementation and wiring for model extensions.
- SSH and SNMP modeler plugins.
- Collector daemon and supporting ZenHub configuration service.
- Custom DataSource type.
- API implementation and wiring for custom datasource type.
- Custom ZenPack install and remove code.
- Adding new zProperties.
- Custom report with a supporting data plugin.
- Including and building external libraries.
- Migrate script.
- Unit tests.
Zenoss 4 only.
- Notifications and triggers.
- Adding new event fields.
Zenoss Service Dynamics only.
- Dynamic View adapters and wiring.
- Analytics adapters and wiring.
- Impact adapters and wiring.