search

ZenPack

The ZenPack YAML file, zenpack.yaml, contains the specification for a ZenPack. It must at at least contain a name field. It may optionally contain one each of the following sections.

  • zProperties

  • device_classes

  • classes

  • class_relationships

  • link_providers

  • event_classes

  • process_class_organizers

Fields

The following fields are valid for a ZenPack entry.

NameDescriptionRequiredTypeDefault Value
nameName (e.g. ZenPacks.acme.Widgeter). Must begin with “ZenPacks.”yesstring
zPropertieszProperties added by the ZenPack.nomap<name, zProperty>{} (empty map)
device_classesDevice classes added by the ZenPack.nomap<path, Device Class>{} (empty map)
classesClasses for device and component types added by this ZenPack.nomap<name, Class>{} (empty map)
class_relationshipsRelationships between classes.nolist<Class Relationship>

[] (empty list)

link_providersDevice link providers.nomap<name, Link Provider>{} (empty map)
event_classesEvent classes and mappings.nomap<path, Event Class>{} (empty map)
process_class_organizersProcess class organizers and process sets.nomap<path, Process Class>{} (empty map)

ZenPack Sections

All except the name field are subsections. See the following documentation for each of these subsections.

Example

The following example shows an example of a zenpack.yaml file with examples of every supported field.

zenpack.yaml
name: ZenPacks.acme.Widgeter

zProperties:
  zWidgeterEnable: {}

device_classes:
  /Server/ACME/Widgeter: {}

classes:
  ACMEWidgeter:
    base: [zenpacklib.Device]

  ACMEWidget:
    base: [zenpacklib.Component]

class_relationships:
  - Widgeter 1:MC Widget

link_providers:
  Virtual Machine:
    link_class: ZenPacks.example.XenServer
    catalog: device
    device_class: /Server/XenServer
    queries: [vm_id:manageIp]
  XenServer:
    global_search: True
    queries: [manageIp:vm_id]

event_classes:
  /Status/Acme:
    remove: false
    description: Acme event class
    mappings:
      Widget:
        eventClassKey: WidgetEvent
        sequence:  10
        remove: true
        transform: |
          if evt.message.find('Error reading value for') >= 0:
              evt._action = 'drop'

process_class_organizers:
  Widget:
    description: Organizer for Widget process classes
    process_classes:
      widget:
        description: Widget process class
        includeRegex: sbin\/widget
        excludeRegex: "\\b(vim|tail|grep|tar|cat|bash)\\b"
        replaceRegex: .*
        replacement: Widget