TECHZEN Zenoss User Community ARCHIVE  

TALES expression for zenpack installation path

Subject: TALES expression for zenpack installation path
Author: [Not Specified]
Posted: 2014-10-27 01:26

What is the TALES expression for zenpack installation path

I wanted to reference some scripts under zenpack_install_path/libexec for my monitoring templates.
How to reference the install path as a TALES expression, so I can update zCommandPath to the same.

Say my zenpack install path is as below:
/opt/zenoss/ZenPacks/ZenPacks.org.service/ZenPacks/org/service/libexec/
I have to update zCommandPath as /opt/zenoss/ZenPacks/ZenPacks.org.service/ZenPacks/org/service/libexec/ for the above to work.

But if installation directory were to change, then this will be different.
${here/ZenPackManager/packs/ZenPacks.org.service/libexec} does not work as expected.

What is the correct TALES expression for finding the installation path of zenpack
And how to validate them easier probably through zendmd

Thanks,
LN



Subject: TALES expression for zenpack installation path
Author: Jan Garaj
Posted: 2014-11-01 18:46

Use:
${here/ZenPackManager/packsZenPacks.org.service/path}/libexec/

zendmd test 1:
[i for i in dmd.ZenPackManager.packs() if i.id=='ZenPacks.org.service'][0].path()
'/opt/zenoss/ZenPacks/ZenPacks.org.service-0.0.0-py2.7.egg/ZenPacks/org/service'

zendmd test 2:
dmd.ZenPackManager.packs.findObjectsById('ZenPacks.org.service')[0].path()
'/opt/zenoss/ZenPacks/ZenPacks.org.service-0.0.0-py2.7.egg/ZenPacks/org/service'

Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.

DevOps stack: Docker / Kubernetes / Mesos / Zabbix / Zenoss / Grafana / Puppet / Ansible / Vagrant / Terraform / Elasticsearch



Subject: Premise: my script/template
Author: Jan Garaj
Posted: 2014-11-09 03:42

Premise: my script/template is part of my zenpack

1.) keep default zCommandPath configuration - you don't need to care about this setting
2.) place your script into /opt/zenoss/ZenPacks/ZenPacks.org.service/ZenPacks/org/service/libexec/myscript.py
3.) set your command datasource in your template - field "Command template":
${here/ZenPackManager/packsZenPacks.org.service/path}/libexec/myscript.py

That's common approach, if you want to include your script/template into zenpack.

Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.

DevOps stack: Docker / Kubernetes / Mesos / Zabbix / Zenoss / Grafana / Puppet / Ansible / Vagrant / Terraform / Elasticsearch



Subject: Thank you
Author: [Not Specified]
Posted: 2014-12-04 03:15

Your explanation was very complete and works nicely.



< Previous
Notification in zep/actions.json of ZenPack doesn't pick up default values
  Next
KeyError: '/zport/dmd/Mibs/SentryCDU'
>