Difference between revisions of "Transforms"

From Zenoss Wiki
Jump to: navigation, search
(Created page with "* [Transforms - Suppress hosts behind down router] This transform will suppress any status/ping errors from devices that are behind routers that you also monitor: evt.messag...")
 
Line 1: Line 1:
* [Transforms - Suppress hosts behind down router]
+
* [[Transforms - Suppress hosts behind down router]]
 
+
This transform will suppress any status/ping errors from devices that are behind routers that you also monitor:
+
 
+
evt.message = "System Down"
+
network = device.os.routes.findObjectsById("0.0.0.0")
+
if network is not None and len(network) > 0:
+
  router = dmd.Devices.findDevice(network[0].getNextHopIp())
+
  if router is not None:
+
    if not router.getPingStatus():
+
        evt.message = evt.message + " - Upstream Router is Down"
+
        evt.eventState = 2
+
        evt.severity = 2
+
  else:
+
    evt.message = evt.message + " - No Upstream Router Found in the monitoring database"
+

Revision as of 16:44, 7 September 2012