Bug 182213 - Bad: undefined symbol: netsnmp_add_global_traphandler
Summary: Bad: undefined symbol: netsnmp_add_global_traphandler
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: net-snmp
Version: 4
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Radek Vokál
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-02-21 02:15 UTC by Andrey
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-08-09 12:30:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Andrey 2006-02-21 02:15:54 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.1 (like Gecko)

Description of problem:
In the documentation (perldoc NetSNMP::TrapReceiver) there is an example:   
#!/usr/bin/perl   
use NetSNMP::TrapReceiver;   
   
sub my_receiver {   
    print "********** PERL RECEIVED A NOTIFICATION:\n";   
   
   # print the PDU info (a hash reference)   
   print "PDU INFO:\n";   
   foreach my $k(keys(%{$_[0]})) {   
       printf "  %-30s %s\n", $k, $_[0]{$k};   
   }   
   
   # print the variable bindings:   
   print "VARBINDS:\n";   
   foreach my $x (@{$_[1]}) {   
       printf "  %-30s type=%-2d value=%s\n", $x->[0], $x->[2], $x->[1];   
   }   
}   
  
NetSNMP::TrapReceiver::register("all", \&my_receiver) ||   
    warn "failed to register our perl trap handler\n";   
  
print STDERR "Loaded the example perl snmptrapd handler\n";   
   
At its start I receive a mistake.   
 
perl: symbol lookup  
error: /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi/auto/NetSNMP/TrapReceiver/TrapReceiver.so:  
undefined symbol: netsnmp_add_global_traphandler  
  

Version-Release number of selected component (if applicable):
net-snmp-perl-5.2.1.2-fc4.1

How reproducible:
Always

Steps to Reproduce:
1. perl code  
#!/usr/bin/perl     
use NetSNMP::TrapReceiver;     
     
sub my_receiver {     
    print "********** PERL RECEIVED A NOTIFICATION:\n";     
     
   # print the PDU info (a hash reference)     
   print "PDU INFO:\n";     
   foreach my $k(keys(%{$_[0]})) {     
       printf "  %-30s %s\n", $k, $_[0]{$k};     
   }     
     
   # print the variable bindings:     
   print "VARBINDS:\n";     
   foreach my $x (@{$_[1]}) {     
       printf "  %-30s type=%-2d value=%s\n", $x->[0], $x->[2], $x->[1];     
   }     
}     
    
NetSNMP::TrapReceiver::register("all", \&my_receiver) ||     
    warn "failed to register our perl trap handler\n";     
    
print STDERR "Loaded the example perl snmptrapd handler\n";   
  
    

Additional info:

Comment 1 Radek Vokál 2006-08-09 12:30:50 UTC
After re-reading the initial request: what are you actually aiming at? The
example perl script is not meant to run standalone! And AFAICS it works just
fine when used as embedded perl within snmptrapd.


Note You need to log in before you can comment on or make changes to this bug.