This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

How to associate {vbdata} from an SNMP trap with a name/static variable

I'm interested in improving the messages we receive from the SNMP Trap Viewer. In particular, I want to learn how to go about associating the various data that can be parsed using the {vbdata} syntax and somehow associate this with static names. Here's an example of an SNMP trap that we currently receive. The two fields highlighted in red relate to two questions that I have:

3/22/2019 3:55 PM : There has been a PIM Neighbor change on ${Caption} (${Hostname}). Please see below for the original trap message:

PIM-MIB:pimNeighborLoss SNMP Trap

     Received Time:3/22/2019 3:55:53 PM

Source:IPAddress(IPAddress)

     Community:edited

     Variable Bindings

pimNeighborIfIndex.10.83.55.1:= 16777571

snmpTrapOID:= PIM-MIB:pimNeighborLoss (1.3.6.1.3.61.1.0.1)

sysUpTime:= 15 days 10 hours 20 minutes 27.50 seconds (133322750)

experimental.1057.1.0:= IPAddress

snmpTrapEnterprise:= PIM-MIB:pimMIBObjects (1.3.6.1.3.61.1)

1. The trap variable pimNeighborIfIndex.10.83.55.1 returns a value of 16777571. I notice that this value doesn't stay the same, even when the same IP address is returned in the pimNeighborIfIndex variable. I'd like to somehow create a name that always associates with pimNeighborIfIndex.10.83.55.1, or whatever the returned IP address might be, that I could then use in the SNMP trap alert emails. For example, if the IP address returns as 10.83.55.1 in the variable name, this variable would associate with a statically-assigned name such as "CompanyA". If the IP address returns as 10.83.55.2, the name would be set to "CompanyB", and so on. I'm only working with about 6 possible addresses, so scalability isn't a concern.

2. Is it possible to somehow grab only part of the pimNeighborIfIndex.10.83.55.1 field and use this in the subject line of the alert email? I can use ${vbdata1} to pull in the returned value of 16777571 in the above example, but I'd like to bring in the variable name and parse out the "pimNeighborIfIndex." part of the variable. This would let me cleanly insert the IP address into the alert message for readability. Is this possible?

Thanks in advance for any guidance.