Administration Guide

  • Docs Home
  • Community Home

3. Creating ZenPacks

Say you have developed a performance template for a new piece of hardware. You have created data sources for the OID's you think are worth monitoring, thresholds to make sure some of these values stay within reasonable limits, and several graph definitions to show this data graphically. Perhaps you also have created a new device class for this hardware. You can create a ZenPack to easily distribute your performance template and device class to other Zenoss administrators. This ZenPack can be entirely created from within the Zenoss user interface.

For another example, say you want to monitor a new piece of software running on one of your servers. You would like to monitor several performance metrics of this software, but they are available only via a programmatic API provided with the software. You could develop a new collector daemon to gather data via this API and provide it back to Zenoss. You might also create a new type of Data Source to provide configuration data for the new collector. Obviously this effort would require development skills and intimate knowledge of Zenoss not necessary for the previous example, but this functionality can still be distributed as a ZenPack.

Use the following instructions and guidelines to create a ZenPack.

When logged into Zenoss as an Administrator click on the Setting link and then on the ZenPacks tab. Select the "Create a ZenPack..." menu item. You will get a dialog asking for a name for your new ZenPack. The name must be of the form ZenPacks.<organization>.<identifier>, where organization is a name that identifies you or your organization and identifier is a string that represents the intent of your ZenPack. For example, ZenPacks.zenoss.HttpMonitor was created by Zenoss to help monitor HTTP sites. Once you have entered a name click the save button. This creates both the ZenPack object in the database as well as a new directory in the file system $ZENHOME/ZenPacks/<your zenpack id>.

Many types of objects can be added to a ZenPack via the user interface. Some examples are:

  • Device Classes

  • Event Classes

  • Event Mappings

  • User Commands

  • Event Commands

  • Service Classes

  • Device Organizers

  • Performance Templates

Devices are the conspicuous omission from this list. Any individual Device is usually specific to a particular site and therefore not likely to be useful to other Zenoss users.

To add one of these database objects to a ZenPack navigate to that object and use the "Add to ZenPack..." menu item. Zenoss will present a dialog which lists all installed ZenPacks. Select the ZenPack to which you want to add this object and click the Add button. To view the objects that are part of a ZenPack navigate to the Settings page then the ZenPacks tab. Click on the name of the ZenPack and you will see a page that lists both the files and the objects that are part of this ZenPack. You can remove objects from the ZenPack by selecting the checkboxes next to them and using the "Delete from ZenPack..." menu item.

ZenPacks can contain items that are not ZEO database items, such as new daemons, Data Source types, skins, etc. These are added to a ZenPack by placing them in the appropriate subdirectory within the ZenPack's directory. See the Core ZenPacks at http://www.zenoss.com/community/projects/zenpacks/ for examples of how to incorporate such items into your ZenPack. Further information regarding ZenPack development is available in the Zenoss Developers Guide.

Discussion regarding development of ZenPacks takes place on the zenoss-dev mailing list and forums: http://community.zenoss.com/forums/viewforum.php?f=3

3.1. Packaging and Distributing Your ZenPack

ZenPacks are generally distributed as .egg files. To create the installable .egg file for a ZenPack use the "Export ZenPack..." menu item in the page menu when viewing a ZenPack. The dialog that follows has two options. The first option simply exports the ZenPack to a file named <ZenPackId>.egg in the $ZENHOME/exports directory on the Zenoss server. The second option does the same but then downloads the exported file to your browser. Other Zenoss administrators can install this exported .egg file as described in the Installing ZenPacks section.

For information on how to make your ZenPack available on the zenoss.com site see http://www.zenoss.com/community/projects/zenpacks/how-to-contribute-a-zenpack