Sriraag
Sriraag

Reputation: 53

Unable to receive snmp-traps on UDP 162

Thanks in advance for the help.

Issue: Unable to receive snmp-traps on udp 162 port. Scenario: Trying to put a nexus 5672 in OpenNMS for monitoring

Pre-Checks done:

  1. I am able to snmpwalk the nexus 5k from my linux node on which OpenNMS is installed.
  2. I am even able to do snmpgets.
  3. I see snmp traffic on udp 161 but they are primarily because of the snmp-get's that opennms is doing.
  4. UNABLE TO SEE ANYTHING WHEN I DO A TCPDUMP ON 162 PORT :(

I have checked if any ACLs are set locally but they are not, iptables as a service is stopped.

I have verified that the snmp-configs are properly pushed.

Configs are pushed on the loop-back interface and there are not acl-groups on the nexus 5k either and there is not firewall between the nexus 5k and the OpenNMS Hosted Linux System

Please help, i do not know what i am missing.

Upvotes: 0

Views: 5631

Answers (2)

Sriraag
Sriraag

Reputation: 53

This got resolved. Everything from the Linux end, and the OpenNMS SNMP end was good. However, the network device had SNMP configs wrongly pushed. I changed it to use the default VRF rather than the loopback address, and it started working.

Upvotes: 0

indigo
indigo

Reputation: 328

Ok, first of all, there are two concepts with SNMP, the first one is polling for data to get data from sensors or discover elements from your device. The monitoring application sends requests to your Nexus device. This is what you do when you issue a snmpwalk or snmpget command. The Nexus device has an SNMP agent running which is listening on port 161/UDP. The second one is, your Nexus device can send messages to your monitoring application. Your monitoring application with OpenNMS needs to have a listener running on port 162/UDP, called SNMP Traps or SNMP Informs.

So trying to debug the problem not getting SNMP Traps with snmpget or snmpwalk does not help in the first place. The communication is initialized by the Nexus device and OpenNMS is the listener for the traps.

I would try to debug the problem with the following steps:

  • Ensure OpenNMS has Trapd enabled and is listening on the right interfaces, e.g. with ss -lnpu sport = :162
  • Make sure you don't have a firewall on your OpenNMS server which blocks traffic to 162/UDP, e.g. iptables -L
  • Use tcpdump to see if the SNMP trap from your Nexus arrives on the OpenNMS server by looking at traffic with target port 162 with protocol UDP.
  • If you're SNMP trap is received from the OpenNMS server, you can then start looking in trapd.log of your OpenNMS server and verify if community settings for the IP is correct. OpenNMS will use the community which is configured for the senders IP address to process the trap

In hope this helps

Upvotes: 1

Related Questions