From: SourceForge.net <no...@so...> - 2006-02-23 12:11:27
|
Bugs item #1436674, was opened at 2006-02-22 13:50 Message generated for change (Comment added) made by radekrat You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112694&aid=1436674&group_id=12694 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: perl Group: linux Status: Open Resolution: None Priority: 5 Submitted By: Radek (radekrat) Assigned to: Nobody/Anonymous (nobody) Summary: [5.3.0.1] undefined symbol: netsnmp_add_global_traphandler Initial Comment: 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 Reproduced with 5.2.1 and 5.3.0.1 ---------------------------------------------------------------------- >Comment By: Radek (radekrat) Date: 2006-02-23 12:11 Message: Logged In: YES user_id=1122867 Additional info, seems that TrapReceiver is not linked with libsnmptrapd root@garfield net-snmp# ./182213.pl /usr/bin/perl: symbol lookup error: /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/NetSNMP/TrapReceiver/TrapReceiver.so: undefined symbol: netsnmp_add_global_traphandler root@garfield net-snmp# ldd -v /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/NetSNMP/TrapReceiver/TrapReceiver.so linux-gate.so.1 => (0x005b3000) libc.so.6 => /lib/libc.so.6 (0x00111000) /lib/ld-linux.so.2 (0x003f3000) Version information: /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/NetSNMP/TrapReceiver/TrapReceiver.so: libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6 libc.so.6 (GLIBC_2.0) => /lib/libc.so.6 /lib/libc.so.6: ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2 ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2 ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2 ---------------------------------------------------------------------- Comment By: Radek (radekrat) Date: 2006-02-23 10:48 Message: Logged In: YES user_id=1122867 That's strange. I can see it inside the lib .. root@garfield net-snmp# ./182213.pl /usr/bin/perl: symbol lookup error: /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/NetSNMP/TrapReceiver/TrapReceiver.so: undefined symbol: netsnmp_add_global_traphandler root@garfield net-snmp# nm -D /usr/lib/libnetsnmptrapd.so.10.0.0 | grep netsnmp_add_global_traphandler 00002500 T netsnmp_add_global_traphandler When I run `make test` there's one test failed. 20:testing SNMPv3 agent USM user management with snmpusm............FAIL and few skipped 28:testing snmpv1 traps are sent by snmpd API...SKIPPED 29:testing snmpv2c traps are sent by snmpd API...SKIPPED 30:testing snmpv1 traps are sent by snmpd without notification mib support...SKIPPED 31:testing snmpv2c traps are sent by snmpd without notification mib support...SKIPPED 44:testing AgentX trap sending support...SKIPPED 54:testing 1st CPU on Solaris using HOST-RESOURCES...SKIPPED 55:testing initial load device on Solaris using HOST-RESOURCES...SKIPPED 57:testing swap on Solaris using HOST-RESOURCES...SKIPPED This is tested on Fedora Core 5 net-snmp package, which is configured with # net-snmp-config --configure-options '--build=i386-redhat-linux' '--host=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--datadir=/usr/share' '--includedir=/usr/include/net-snmp' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-static' '--enable-shared' '--with-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -lcrypto' '--with-ldflags=' '--with-sys-location=Unknown' '--with-logfile=/var/log/snmpd.log' '--with-persistent-directory=/var/net-snmp' '--with-mib-modules=host agentx smux ucd-snmp/lmSensors ucd-snmp/diskio' '--with-libwrap=/usr/lib' '--sysconfdir=/etc' '--enable-ipv6' '--enable-ucd-snmp-compatibility' '--with-openssl' '--with-pic' '--enable-embedded-perl' '--enable-mfd-rewrites' '--with-sys-contact=root@localhost' 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' 'build_alias=i386-redhat-linux' 'host_alias=i386-redhat-linux' 'target_alias=i386-redhat-linux-gnu' ---------------------------------------------------------------------- Comment By: Thomas Anders (tanders) Date: 2006-02-23 09:46 Message: Logged In: YES user_id=848638 netsnmp_add_global_traphandler is covered by libnetsnmptrapd.so.10. This works for me. Are you sure you're not mixing different versions/installations of net-snmp on your system? Also, did "make test" run successfully? (your test is covered by the test suite) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112694&aid=1436674&group_id=12694 |