This section describes the files and directory structures that make up most ZenPacks.
-
setup.py
This file contains parameters for use by setuptools and distutils in creating eggs and doing source installs. Zenoss creates an appropriate setup.py when a ZenPack is created. Any time a ZenPack is saved or exported via the GUI Zenoss will modify certain values at the top of setup.py. The lines that Zenoss modifies are clearly commented and segregated at the top of the file. If you wish to make changes to setup.py you can safely do so as long as you leave those lines intact.
-
ZenPacks
This directory mirrors the dotted name structure of your ZenPack name. For example, if your ZenPack name is ZenPacks.MyCompany.MyZenPack then this directory will contain a directory named MyCompany which will contain a MyZenPack directory. This last directory with the same name as the last part of your ZenPack name is where most of the ZenPac code resides. The structure of that directory is very similar to that of previous non-egg ZenPacks.
-
Other directories
As mentioned above, the ZenPacks directory will contain a directory structure that mirrors the name of your ZenPack.
-
<ZenPackId>
This is the directory whose name is that of the last part of your dotted ZenPack name.
-
__init__.py
This file contains any code that needs to be executed when the ZenPack is loaded. Zenoss loads all installed ZenPacks on startup. Typically this file contains a few lines that will register a skins directory if the ZenPack provides one. Also, if this class contains a class named ZenPack then on installation Zenoss will create an instance of that class rather than the base ZenPack class in the object database.
-
daemons
See below for more details on providing daemons in ZenPacks.
-
datasources
See below for more details on providing datasource classes in ZenPacks.
-
lib
This directory is intended to hold any 3rd part modules or other code your ZenPack depends on. A module named Foo in this directory would be imported with
import ZenPacks.MyCompany.MyZenPack.lib.Foo
-
migrate
See below for more details on migrating between versions of your ZenPack.
-
modeler
See below for more details on providing modeler plugins in ZenPacks.
-
objects
Database objects such as Device Classes and Performance Templates that are added to the ZenPack via the GUI are exported to an objects.xml file in this directory. When the ZenPack is installed on another system those objects will be copied into that object database.
-
reports
This directory contains any report plugins provided by the ZenPack.
-
services
Zenoss daemons usually communicate with ZenHub to retrieve their configuration, send events, and write performance data. If a ZenPack provides a daemon then it typically will also provide a ZenHub service for that daemon. See the section on ZenHub for further details.
-
skins
This directory contains any skins directories that should be added to Zope. Note that this contains directories of skins, not the skin files themselves. If you include skins directories make sure that the __init__.py file in the directory above skins is registering this directory. (The default __init__.py file provided in new ZenPacks does this for you.)
-
-
-
-
build
This directory is created by Python when the ZenPack is exported to an egg file or when it is installed from source. This directory can safely be deleted at any time if you wish and need not be kept within any version control system.
-
dist
This directory is created when thet ZenPack is exported to an egg file. The egg file is initially created within here then copied to $ZENHOME/export. This directory can safely be deleted at any time if you wish and need not be kept within any version control system.
-
<ZenPackId>.egg-info
This directory contains files which describe the egg metadata. This is created when the egg file is generated or the ZenPack is installed from source. This directory can safely be deleted at any time if you wish and need not be kept within any version control system.