This month’s tips are from Zenoss engineers Chet Luther and Chip Holden. First, from Chet we have an event transform for suppressing all further events from a device when they are unreachable by ping.
Device Event Suppression
If you want to suppress additional events from devices that Zenoss already knows are ping down, you can use the new hierarchical event transformation feature of Zenoss 2.4 to achieve this. You will need to setup a global transform by going to Events in the web interface and choosing More -> Transform from the table menu. Paste in the following transformation and click save.
# Suppress any non-ping, non-clear events from devices that have outstanding
# ping down events.
# This transform is sensitive to the event cache timeout. If the ping down
# event comes in less than "timeout" seconds before the subsequent events, the
# subsequent events will not be suppressed. You can find the event cache
# timeout setting on the Event Manager page in the web interface.
if getattr(evt, 'severity', 0) > 0 \
and getattr(evt, 'eventClass', '/Unknown') != '/Status/Ping' \
and device and device.getPingStatus() > 0:
evt.eventState = 2
Now you should not receive any further events for a device until it is reachable by ping again.
Location Event Suppression
This tip comes from Chip ‘mrchippy’ Holden in response to the forum thread “dependencies… again!”. The user was looking for a way to stop all events from a location when a router to that location goes down. This event transform would be applied similarly to the transform above:
if device and device.location().id == 'location_1' and device.id != 'test_router_1':
dc1_router = device.findDevice('test_router_1')
if dc1_router.getPingStatus() > 0:
evt.eventState = 2
This should suppress all events in the ‘location_1′ when the device called ‘test_router_1′ is no longer pingable. Note that eventState (0,1,2) maps to New, Acknowledged, Suppressed. Notice that the code above could be modified to work with Groups or Systems as well, but they use lists rather than single values since devices may belong to multiple Systems or Groups.