Developer's Guide

  • Docs Home
  • Community Home

6. Development Mode

New ZenPacks can be created in Zenoss by going to the SettingsZenPacks page and selecting the Create ZenPack... menu item on the ZenPacks page. This creates the ZenPack on the filesystem at $ZENHOME/ZenPacks/ZenPacks.community.YourZenPack and installs it into Zenoss. You may then proceed to add device classes, templates, MIBs or just about anything to the ZenPack with the Add to ZenPack menu option. 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've installed freshly exported .egg ZenPack on another system (or uninstalled and re-installed your new ZenPack) you can no longer add things to the ZenPack.

6.1. Source ZenPacks

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.

6.2. Converting .eggs to Development Mode

If you wish to convert an already installed ZenPack, or to install and convert an .egg ZenPack, follow these steps.

  1. Install the .egg as you would normally.

  2. Restart Zope with

    zopectl restart
  3. Copy the ZenPack development files into the .egg's directory (the CONTENTS directory is unnecessary):

    cp $ZENHOME/Products/ZenModel/ZenPackTemplate/* \
    $ZENHOME/ZenPacks/ZenPacks.community.YourZenPack-1.0.2-py2.4.egg/
  4. You may now make any modifications to the ZenPack, updating the version number, adding new device classes, etc.

  5. Go into the ZenPack from the ZenPacks tab in Settings.

  6. Export the ZenPack. The changes will be persisted to the new .egg and the filesystem.

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 (e.g. 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 (e.g. ZenPacks.community.YourZenPack-1.0.2-py2.4.egg) or it may fail to download. Use the version in the export directory.