Skip to content

Process classes

Process classes are used to define sets of similar running processes using a regular expression. You can then monitor various aspects of the running processes, such as CPU and memory usage, with a datasource.

To define a class, supply the process class organizer under which the process class will reside. Optionally add a description of the organizer. Then, for each process class, supply the processes to include/exclude, description, and replacement text. You can also optionally override specific zProperties of a process class, such as zMonitor or zFailSeverity. See Process class fields.

The following example shows an example of a zenpack.yaml file with an example of a definition of a process class.

zenpack.yaml
name: ZenPacks.acme.Processes

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

When you define a process class organizer and/or class which already exists, any settings defined in your ZenPack will overwrite existing settings.

Since this is a YAML “mapping”, the minmal specification (name only) would look like:

zenpack.yaml
process_class_organizers:
  Widget: {}

Process class organizer fields

The following fields are valid for a process class organizer entry.

name (required, string, default = implied from key in process_class_organizers map)
Name (e.g. Widget or Widget/ACME).
description (optional, string, default = "" (empty string))
Description of the process class organizer.
create (optional, boolean, default = true)
Should the process class organizer be created when the ZenPack is installed?
remove (optional, boolean, default = false)

Should the process class organizer be removed when the ZenPack is removed?

This will only apply to a ZenPack that has created the process class organizer. - Process class organizers not created by the ZenPack are removed. - Process class organizers created by the platform are never removed.

reset (optional, boolean, default = false)
If true, any zProperties defined here will override those of the target process class organizer.
zProperties (optional, map, default = {} (empty map))
zProperty values to set on the process class organizer.

Process class fields

The following fields are valid for a process class entry.

name (required, string, default = implied from key in process_classes map)
Name of the process class (e.g. widget).
description (optional, string, default = "" (empty string))
Description of the process class.
zProperties (optional, map, default = {} (empty map))
zProperty values to set on the process class.
includeRegex (optional, string, default = name)
Include processes matching this regular expression.
excludeRegex (optional, string, default = "" (empty string))
Exclude processes matching this regular expression.
replaceRegex (optional, string, default = "" (empty string))
Replace command line text matching this regular expression.
replacement (optional, string, default = "" (empty string))
Text which will replace the command line text that matches replaceRegex.
monitor (optional, boolean, default = None (don't override))
Enable monitoring? Overrides parent process class organizer setting.
alert_on_restart (optional, boolean, default = None (don't override))
Send event on restart? Overrides parent process class organizer setting.
fail_severity (optional, integer, default = None (don't override))
Failure event severity. Overrides parent process class organizer setting (0=Clear, 1=Debug, 2=Info, 3=Warning, 4=Error, 5=Critical).
modeler_lock (optional, integer, default = None (don't override))
Lock process components. Overrides parent process class organizer setting (0=Unlocked, 1=Lock from Deletes, 2=Lock from Updates).
send_event_when_blocked (optional, boolean, default = None (don't override))
Send and event when action is blocked? Overrides parent class organizer setting.