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
snmptrapd drops trap packets
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: snmptrapd drops trap packets
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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: snmptrapd drops trap packets
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
[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
You do not have the required permissions to view the files attached to this post.
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: snmptrapd drops trap packets
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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: snmptrapd drops trap packets
From about 1000 traps /minute and more.
BRegards
BRegards
Re: snmptrapd drops trap packets
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:
This gives you number of kernel default settings, but look for these specifically: (this is my example output from the command)
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
I ran the following on my CentOS 6.5 box:
Code: Select all
sysctl -A | grep rmem
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
/Luke
/Luke
Re: snmptrapd drops trap packets
Thanks, I will try to edit these settings and let you know.
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: snmptrapd drops trap packets
Great, keep us up to date with your tests!