Transforms - Suppress Events by Custom Property

From Zenoss Wiki
Revision as of 06:32, 24 November 2012 by Chet Luther (Talk | contribs)$7

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)
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 “vpn1.example.com” on a device on the other side of vpn1.example.com.
  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 vpn1.example.com if vpn1.example.com is down.