![]() |
![]() |
Subject: | Event transformation of snmp trap linkDown problem |
Author: | [Not Specified] |
Posted: | 2015-02-17 14:26 |
Hello.
I'm trying to write transformation on linkDown snmp trap. I want to monitor interfaces on switches (Juniper, Dell MXL) and show some summarization with physical port number on a event board, for example "Interface down on interface
It's easy to write transformation when it is only Juniper switch, because Juniper switch sends IfName in snmp trap.
My bigest problem is MXL switch because this switch sends only ifIndex without ifName. I tried to get interface name from interfaces list (using ifIndex), but i'm not receiving any name or description.
I tried many combinations without success, for example (and many more):
index = getattr(evt, 'ifIndex', 0)
descr = getattr(evt, 'ifDescr', 'Unknown Interface')
evt.component = descr
if device:
description = ''
for iface in device.os.interfaces():
if index and iface.ifindex == index:
descr = iface.description
elif descr and iface.name == descr:
descr = iface.description
evt.summary = 'Link down on %s' % (descr)
Can someone help me with this .
Thanks for the response.
Marcin
< |
Previous Number of failed ping attempts |
Next Cloudstack Monitoring : No data returned for command |
> |