Page 1 of 1

snmptrapd drops trap packets

Posted: Thu Oct 09, 2014 9:49 am
by mon-team
Hello,

We configured snmptrapd on our nagios server to process snmp traps.
We noticed that snmptrapd drops trap packets when snmp traps are sent at high rate.

We found this page (http://sourceforge.net/p/net-snmp/mailm ... e/7883695/) which suggest to enlarge the buffer of the application by increasing the value of the parameter "serverRecvBuf"

The manpage of snmp.conf says:
-----------
serverRecvBuf INTEGER
specifies the desired size of the buffer to be used when receiving incoming SNMP requests. If the OS hard limit is lower than the serverRecvBuf
value, then this will be used instead. Some platforms may decide to increase the size of the buffer actually used for internal housekeeping.

This directive will be ignored if the platforms does not support setsockopt().
-----------

How can we find out the current value of serverRecvBuf?

Thanks

BRegards

Re: snmptrapd drops trap packets

Posted: Thu Oct 09, 2014 5:01 pm
by sreinhardt
Can you post your /etc/snmp/snmptt.ini /etc/snmp/snmpd.conf /etc/snmp/snmptrapd.conf. This may be an issue inherent to trapd, but let's make sure configs are good and not doing additional steps they don't need to that might be causing this.

Re: snmptrapd drops trap packets

Posted: Fri Oct 10, 2014 3:24 am
by mon-team
You can see in attachment our config snmpd.conf, snmptrapd.conf and snmptt.ini

[root@nagios]# ps aux | grep snmptrapd
root 30044 0.0 0.0 217544 29356 ? SNs 03:45 0:06 /usr/sbin/snmptrapd -n -On -a -Lf /var/log/snmptrapd.log -p /var/run/snmptrapd.pid

BRegards

Re: snmptrapd drops trap packets

Posted: Fri Oct 10, 2014 4:52 pm
by sreinhardt
Well, I gotta say those are some of the most efficient configs I've seen. It might take a bit, but let me see about that variable. While I am at it, what rate of traps are you sending that this is becoming an issue?

Re: snmptrapd drops trap packets

Posted: Mon Oct 13, 2014 8:11 am
by mon-team
From about 1000 traps /minute and more.

BRegards

Re: snmptrapd drops trap packets

Posted: Mon Oct 13, 2014 10:48 am
by lgroschen
I have read a little about this where the buffer defaults will limit the amount snmptrapd will process at once.

I ran the following on my CentOS 6.5 box:

Code: Select all

sysctl -A | grep rmem
This gives you number of kernel default settings, but look for these specifically: (this is my example output from the command)

Code: Select all

[root@localhost tmp]# sysctl -A | grep rmem
net.core.rmem_max = 124928
net.core.rmem_default = 124928
net.ipv4.tcp_rmem = 4096  87380  4194304
net.ipv4.udp_rmem_min = 4096
Just an idea of how to brainstorm about the amount your system is set to by default. If the serverRecvBuf is not set then I think it will use the system default above.

/Luke

Re: snmptrapd drops trap packets

Posted: Fri Oct 31, 2014 6:18 am
by mon-team
Thanks, I will try to edit these settings and let you know.

Re: snmptrapd drops trap packets

Posted: Fri Oct 31, 2014 9:52 am
by slansing
Great, keep us up to date with your tests!