1

I am experimenting with sending and receiving SNMP traps via net-SNMP. I have a script that sends traps out to localhost. I have snmptrapd set to write traps to a file. This works fine, except for the fact that there is about a 5 second delay between the trap getting sent and receiving the trap. It is all on the same computer (snmptrapd is running on localhost), so why would there be such a large delay? Also, when I send a large amount of traps at once, like 100 within 5 seconds, it will not write more than 1 every ~5 seconds. Thanks!

Greg
  • 11
  • 2
  • `tcpdump` is your friend. – gravyface Jul 18 '13 at 18:54
  • Sounds like some sort of rate limiting. Check your SNMP configs, firewall, and `tcpdump`. – Michael Hampton Jul 18 '13 at 19:13
  • There is nothing in the configs and the firewall is off. I can't directly tell what is wrong with tcpdump. I even tried using 2 virtual machines as opposed to one, one for sending and the other for receiving traps. Needless to say there is still a delay. The receiving server gets packets immediately after the trap is sent, and then gets packets about 5 seconds later, which is when the trap is actually received. – Greg Jul 19 '13 at 18:46
  • Did you ever resolve this? I am having the exact same issue. Still haven't found any answer but I will keep digging and post back if I do. – Cairy Hunt Dec 13 '13 at 09:21

1 Answers1

1

Turns out the issue was DNS look ups timing out so I just pushed the -n flag to the options lines in /etc/defaults/snmpd. This was on Debian 6.0.

# snmpd options (use syslog, close stdin/out/err).
SNMPDOPTS='-Lsd -Lf /var/log/snmpd.log -n -u snmp -g snmp -I -smux -p /var/run/snmpd.pid'

# snmptrapd options (use syslog).
TRAPDOPTS='-Lsd -Lf /var/log/snmptrapd.log -n -u snmp -g snmp -p /var/run/snmptrapd.pid'

This was for: NET-SNMP Version: 5.4.3 on a Debian 6.0 server, the behaviour seems to have changed since Debian 5.0.

Ladadadada
  • 26,337
  • 7
  • 59
  • 90
Cairy Hunt
  • 11
  • 1