diff --git a/checks/cisco_eigrp_interface b/checks/cisco_eigrp_interface index 51667c311b3f97a621bc8a0de96f543fd618dadc..aa8ccc6d5cbf0f484561f5f39f48f94c11f6eb35 100644 --- a/checks/cisco_eigrp_interface +++ b/checks/cisco_eigrp_interface @@ -13,6 +13,7 @@ # 2018-08-06: modified scan function # 2019-10-14: added support for hamc-sha-256 authentication, md5 moved to warn, none moved to crit # 2019-10-16: added support for IPv6 and VRFs, added data parser function +# 2019-10-31: changed item from interface long-name to interface short name # # snmpwalk sample # @@ -158,8 +159,20 @@ def parse_cisco_eigrp_interface(info): } return name.get(mode, 'unknown') - def render_ip_address(bytestring): - return ".".join(["%s" % ord(m) for m in bytestring]) + def get_short_if_name(st): + names = {'ethernet': 'Eth', + 'fastethernet': 'Fa', + 'gigabitethernet': 'Gi', + 'tengigabitethernet': 'Te', + 'fortygigabitethernet': 'Fo', + 'hundredgigabitethernet': 'Hu', + 'port-channel': 'Po', + 'tunnel': 'Tu', + } + for item in names.keys(): + if st.lower().startswith(item): + st = st.lower().replace(item, names.get(item)) + return st EigrpInterfaces, InterfaceNames, VrfInfo = info EigrpIfTable = [] @@ -175,7 +188,7 @@ def parse_cisco_eigrp_interface(info): for ifindex, ifname, iftype in InterfaceNames: if int(ifindex) == cEigrpIfIndex: # compare interface index if not int(iftype) == 24: # skip Loopback interfaces - cEigrpIfName = ifname + cEigrpIfName = get_short_if_name(ifname) if cEigrpIfName != '': diff --git a/cisco_eigrp.mkp b/cisco_eigrp.mkp index 4a32f9cd9fb97ee04d5fc9463cf53110f2fc7535..2db0e6c906f46d25f407c99521854d95fd1a1bc4 100644 Binary files a/cisco_eigrp.mkp and b/cisco_eigrp.mkp differ