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:
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.