nav
nav copied to clipboard
snmptrapd is unable to identify trap agents that use a different IP to send traps than to receive SNMP queries
Normally, routers are registered in NAV with their loopback IP address. As it turns out, not all routers will send traps from this address.
However, NAV's snmptrapd
is only able to identify an agent based on the management address registered in NAV, as evidenced by this implementation:
https://github.com/Uninett/nav/blob/7363b53da15ee018ef0a75fa1b4a1ec52b54f086/python/nav/snmptrapd/trap.py#L63-L78
NAV already knows all the other IP addresses such a router operates with; these are all stored in the the gwportprefix
table. The SQL statement in line 68 could easily be extended to also look at these addresses.