Menu

#1388 Missing traps for snmptrapd

traps
closed
nobody
None
5
2012-11-08
2005-06-23
No

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 '

Discussion

  • Thomas Anders

    Thomas Anders - 2005-06-24

    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?

     
  • Alex Peeters

    Alex Peeters - 2005-06-24

    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

     
  • Alex Peeters

    Alex Peeters - 2005-06-24

    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.

     
  • Alex Peeters

    Alex Peeters - 2005-06-24

    Logged In: YES
    user_id=590764

    • increase the UDP buffers as explained in snmp.conf(5)

    Do you mean 'serverRecvBuf' ?

       serverRecvBuf integer
              serverRecvBuf  is  used  to  specify the receive
    

    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

     
  • Thomas Anders

    Thomas Anders - 2005-06-28

    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?

     

Log in to post a comment.

MongoDB Logo MongoDB