Discussion:
empty component in snmp_linkDown trap (plus fix)
zenorr
2012-04-11 09:27:43 UTC
Permalink
zenorr [http://community.zenoss.org/people/zenorr] created the discussion

"empty component in snmp_linkDown trap (plus fix)"

To view the discussion, visit: http://community.zenoss.org/message/65816#65816

--------------------------------------------------------------
Hi,

In Zenoss 3.2.1, I was getting no component part from the snmp trap snmp_linkDown transformation. The cause in my case was the presence of the full Cisco MIB set (ZenPacks.Nova.Cisco.Mibs). The test "if key.find('1.3.6.1.2.1.2.2.1.1') >= 0:" would never match. Here is a corrected transformation. Having the MIB loaded, the items() contains "ifIndex", not "1.3.6.1.2.1.2.2.1.1".

index = None
for key, value in evt.__dict__.items():
   if ((key.find('1.3.6.1.2.1.2.2.1.1') >= 0) or (key.find('ifIndex') >= 0)):
      index = value
      break
if index is not None:
   for obj in device.os.interfaces.objectItems():
      if obj[1].ifindex == index:
         evt.component = obj[1].id
         break
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65816#65816]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...