ZenPacks Creation

Preparation

  • Define names
    • ZenPack name: ZenPacks.<organization>.<function>
    • ObjectClass names
    • Relationship names
      • distinct from ObjectClass names

Creating the ZenPack

  • Zenoss4 : Create from GUI*
    • ADVANCED -> Settings -> ZenPacks, Action->Create a ZenPack

    • Define version, dependencies and author

    • cp -r $ ZENHOME/ZenPacks/<ZenPackName> /z/

    • zenpack --link --install /z/<ZenPackName>

      This places a single link file under $ZENHOME/ZenPacks

    • zenoss restart

  • Create with ZenPackLib
    • cd /z/
    • zenpacklib --create ZenPacks.community.dummy
    • zenpack --link --install /z/ZenPacks.community.dummy
    • zenoss restart

Installing the ZenPack

See section above for the steps. When installing, if the ZenPack is already present, the ZenPack’s remove method is executed with leaveObjects=True, followed by the install method.

Removing the ZenPack

zenpack --remove ZenPack.community.dummy

zenoss restart

Elements from GUI

  • Device Class
  • MIBs
  • Monitoring templates

Other elements

  • Object Classes
    • One file per device and per component
    • Links by matching pair of relationships
    • Files in base directory
  • Modeler plugins
  • UI Javascript

Egg file

  • Created from subfolder build/lib into dist folder and finally copied to $ZENHOME/export
  • Generation together with objects.xml
  • Create egg without updating objects.xml cd <ZenPackFolder> python setup.py bdist_egg

Migration

  • Subclass ZenModel.ZenPack.ZenPackMigration

Convert egg to Development Mode

  1. Install egg as usual.
  2. Restart Zenoss.
  3. Copy the ZenPack development files into egg’s folder
cp $ZENHOME/Products/ZenModel/ZenPackTemplate/* $ZENHOME/ZenPacks/ZenPacks.community.dummy-1.0.2-py2.4.egg/
  1. Edit ZenPack
  2. Export ZenPack

ZenPack Template

bin/placeholder.txt
browser/configure.zcml
browser/resources/css/placeholder.txt
browser/resources/img/placeholder.txt
browser/resources/js/ExampleDevice.js
browser/__init__.py
daemons/zenexample
datasources/ExampleDataSource.py.example
datasources/__init__.py
lib/__init__.py
libexec/placeholder.txt
migrate/ExampleMigration.py
migrate/__init__.py
modeler/plugins/community/cmd/ExampleCMD.py.example
modeler/plugins/community/cmd/__init__.py
modeler/plugins/community/snmp/ExampleSNMP.py.example
modeler/plugins/community/snmp/__init__.py
modeler/plugins/community/__init__.py
modeler/plugins/__init__.py
modeler/__init__.py
reports/Example_Reports/Example_Report.rpt.example
reports/plugins/example_plugin.py
services/ExampleConfigService.py
services/__init__.py
tests/testExample.py
tests/__init__.py
zep/actions.json.example
zep/zep.json.example
__init__.py
analytics.py
configure.zcml
dynamicview.py
events.py
ExampleComponent.py
ExampleDevice.py
impact.py
info.py
interfaces.py
zenexample.py