Skip navigation
Currently Being Moderated

Restoring ZenPacks to Development Mode

VERSION 3  Click to view document history
Created on: Sep 14, 2009 11:16 AM by Matt Ray - Last Modified:  Dec 19, 2011 12:14 PM by Nick Yeates

New ZenPacks

New ZenPacks can be created in Zenoss by going to the Settings->ZenPacks 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.

 

export.jpg

The Problem

The problem with your freshly exported .egg ZenPack is that once you've installed it on another system (or uninstalled and re-installed your new ZenPack) you can no longer add things to the ZenPack.  There are 2 solutions available to resolve this issue.

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

 

   zenpack --link --install ZenPacks.community.YourZenPack

 

followed by


   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 and push them back to the github repository.

 

 

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 a normal egg ZenPack.
  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. Save and then Export the ZenPack.  The changes will be persisted to the new .egg and the filesystem. 
  7. There is a minor bug in the "export and download" option.  The new version that is saved into 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.
Comments (0)