Transforms - Suppress Events by Custom Property

From Zenoss Wiki
This is the approved revision of this page, as well as being the most recent.
Jump to: navigation, search

One common scenario where event suppression is useful is where you have many devices on the other side of VPN tunnels or point-to-point WAN or MPLS connections. A way to address this is to add a custom property that allows you to set another device that each device depends on. See the following approach.

  1. Create a custom property at /Devices called cVPNGateway.
  2. Set the value for this cVPNGateway to “” on a device on the other side of
  3. Create the following event transform for the root (/Events) event class.
if device and device.cVPNGateway and evt.severity in (4, 5):
    gateway = dmd.Devices.findDeviceByIdExact(device.cVPNGateway)
    if gateway and gateway.getStatus > 0:
        evt.eventState = 2  # 2 == suppressed

This will suppress any events for devices with their cVPNGateway property set to if is down.