Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question
    
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 9:21

1 Answer 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.