JosefJezek
1/17/2014 - 4:09 PM

Zenoss ConstructionKit

Zenoss ConstructionKit

Zenoss ConstructionKit

Build

  • Create ZenPacks from GUI with dependency on Zenpacks.community.ConstructionKit
  • cd $ZENHOME/ZenPacks/ZenPacks.community.<Name>/ZenPacks/community/<Name>
  • `rm -rf *'
  • vi Definition.py
  • touch __init__.py
  • zenpack --link --install $ZENHOME/ZenPacks/ZenPacks.community.<Name>
  • zopectl restart ; zenhub restart
  • CDIR="$ZENHOME/ZenPacks/ZenPacks.community.ConstructionKit/ZenPacks/community/ConstructionKit"
  • $CDIR/bin/rebuild.py -Z ZenPacks.community.<Name>
  • zopectl restart ; zenhub restart

__init__.py

from ZenPacks.community.ConstructionKit.Construct import *
from ZenPacks.community.ConstructionKit.ZenPackConstruct import *
import Definition

init = Initializer(Definition)
for c in init.constructs: exec c.onCollectorInstalled()
#ZenPack = init.getZenPackClass()
class ZenPack(ZenPackConstruct):
    constructs = init.constructs
    packZProperties = init.props
    definitions = init.definitions

Create egg

git clone https://github.com/zenoss/ZenPacks.community.libvirt.git
cd ZenPacks.community.libvirt/
python setup.py bdist_egg
zenpack --install dist/ZenPacks.community.libvirt-1.96-py2.7.egg