New ZenPacks can be created in Zenoss by navigating to Advanced > Settings > ZenPacks and selecting Create a ZenPack from the Action menu. This creates the ZenPack on the file system at $ZENHOME/ZenPacks/ZenPacks.community.YourZenPack
and installs it into Zenoss. You may then proceed to add device classes, templates, and MIBs to the ZenPack. (This is known as "development mode" for the ZenPack.) Once you are happy with your ZenPack, you can export it for others to use. However, once you install a freshly exported .egg
ZenPack on another system (or uninstall and re-install your new ZenPack) you can no longer add things to the ZenPack.
If you have the source for the ZenPack available you can simply attach to the source tree. Assuming that the source directory is ZenPacks.community.YourZenPack
, install the ZenPack with the following commands:
zenpack --link --install ZenPacks.community.YourZenPack zopectl restart
Your ZenPack should now be usable and back in development mode. Changes made to the ZenPack will be persisted back to the source tree, you may still export and download as necessary. When you are satisfied with your changes, you may commit them back to the Subversion repository.
If you wish to convert an already installed ZenPack, or to install and convert an .egg
ZenPack, follow these steps.
Install the
.egg
as you would normally.Restart Zope with the command:
zopectl restart
Copy the ZenPack development files into the
.egg
's directory (theCONTENTS
directory is unnecessary):cp $ZENHOME/Products/ZenModel/ZenPackTemplate/* \ $ZENHOME/ZenPacks/ZenPacks.community.YourZenPack-1.0.2-py2.4.egg/
You can now make any modifications to the ZenPack, such as updating the version number or adding new device classes.
Go into the ZenPack (from Advanced > Settings, select ZenPack from the left panel, and then click the ZenPack).
Export the ZenPack (select Export ZenPack from the Action menu). The changes will be persisted to the new
.egg
and the file system.
Note
There is a minor bug in the export and download functions. The new version saved in the export directory will have the correct name with all the updates (for example, ZenPacks.community.YourZenPack-1.0.3-py2.4.egg
). If you choose to export and download the ZenPack, it will have the original name despite the updated version (for example, ZenPacks.community.YourZenPack-1.0.2-py2.4.egg
) or it may fail to download. Use the version in the export
directory.