Transforms - Suppress Events by Location

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

In any network with many sites connected by either VPN tunnels, MPLS or direct links you may find that the most common network failure is loss of connectivity to an entire site. In these cases a good approach to doing effective event suppression in Zenoss would be to create a single transform that contained a map of Zenoss locations to the primary gateway at each site.

This will allow the following transform to suppress all events from a site when the gateway goes down. It's important to not put the gateway device in the location or it's failure will also be suppressed.

GATEWAY_MAP = {
    '/Austin, TX': 'vpn1.zenoss.com',
    }
 
gateway_id = GATEWAY_MAP.get(getattr(evt, 'Location', ''))
if gateway_id:
    gateway = dmd.Devices.findDeviceByIdExact(gateway_id)
    if gateway and gateway.getStatus() > 0:
        evt.eventState = 2  # 2 == suppressed