more /etc/snmptrapd.conf
traphandle
default /opt/nagios/libexec/snmp/snmpDefaultLog.pl
more /opt/nagios/libexec/snmp/snmpDefaultLog.pl
#!/usr/bin/perl -w
my $now=time;
my $trap;
open(LOG, ">>/opt/nagios/var/snmpDefault.log") ||
exit ;
print LOG "---$now---\n" ;
while (<stdin>) {
print LOG "$_" ;
$trap .= $_;
}</stdin>
close(LOG) ;
more /etc/snmp/send1000traps.pl
my $sendtrap = "";
for (my $a = 1; $a <= 1000; $a++) {
print "$a ";
$sendtrap .= "snmptrap -v 2c -c public localhost \"\"
ucdStart sysContact.0 s \"$a\"\n";
}
system ($sendtrap);
into the file /opt/nagios/var/snmpDefault.log are missing
30% of the sended traps
by '/etc/snmp/send1000traps.pl '
Logged In: YES
user_id=848638
Traps over UDP are unreliable by nature. Try to
- increase the UDP buffers as explained in snmp.conf(5)
- use snmpinform instead
BTW. what net-snmp version and platform is this?
Logged In: YES
user_id=590764
Version 5.2.1
- Traps over UDP are unreliable by nature
I now, but 30 % of the traps that are sended to localhost?
- use snmpinform instead
instead of snmptrapd?
- Try to increase the UDP buffers as explained in snmp.conf
I will check this
Logged In: YES
user_id=590764
When i use snmpinform insted of sendtrap, al traps are
received.
Only i received some traps now 2, 3 4 or 5 times.
Logged In: YES
user_id=590764
Do you mean 'serverRecvBuf' ?
buffer size (in
bytes) for the initialization of server sockets (eg.
snmpd,
snmptrapd). If the OS hard limit is smaller than
serverRecvBuf
the resulting buffer will be lowered so it is close to
the hard
limit. Some platforms may decide to
increment the actual
buffersize themselves for internal housekeeping.
This directive
will be ignored on platforms that don't support
Logged In: YES
user_id=848638
Yes, serverRecvBuf on the server side. Please note that
snmptrapd is single-threaded and will miss any trap that
arrive during the time it handles another, unless the UDP
buffer is able to still hold the packet.
Do you agree that this bug can be closed?