Am running Net-SNMP, as on Fedora Core 4 with the following RPMs
installed
net-snmp-perlmods-5.2.2-1
net-snmp-devel-5.2.2-1
net-snmp-debuginfo-5.2.2-1
net-snmp-5.2.2-1
These were created from the source rpm using the following command:
rpmbuild -ba /usr/src/redhat/SPECS/net-snmp.spec --define
'_with_perl_modules 1' --define '_with_embedded_perl 1'
snmp.conf file reads as follows:
mibfile /home/neil/.snmp/OSTtemp.mib
defVersion 1
defCommunity Omnitron
snmptrapd.conf reads as follows:
perl do "/etc/snmp/mytrapd.pl";
mytrapd.pl reads as follows:
#!/usr/bin/perl
use NetSNMP::TrapReceiver;
sub my_receiver {
print STDERR "********** PERL RECEIVED A NOTIFICATION:\n";
# print the PDU info (a hash reference)
print LOGFILE "PDU INFO:\n";
foreach my $k(keys(%{$_[0]})) {
printf " %-30s %s\n", $k, $_[0]{$k};
}
print STDERR "madeit1\n";
# print the variable bindings:
print LOGFILE "VARBINDS:\n";
foreach my $x (@{$_[1]}) {
printf " %-30s type=%-2d value=%s\n",
$x->[0], $x->[2], $x->[1];
}
print STDERR "madeit2\n";
}
open (LOGFILE, ">/var/log/snmptraps.log");
NetSNMP::TrapReceiver::register("all", \&my_receiver) ||
warn "failed to register our perl trap handler\n";
print STDERR "Loaded the example perl snmptrapd handler\n";
1;
snmptrapd child process crashes as indicated by gdb
set follow-fork-mode -- Set debugger response to a program call of fork
or vfork
Quit
Starting program: /usr/sbin/snmptrapd
Reading symbols from shared object read from target memory...(no
debugging symbols found)...done.
Using host libthread_db library "/lib/libthread_db.so.1".
Loaded system supplied DSO at 0x4f8000
[Thread debugging using libthread_db enabled]
[New Thread -1208936768 (LWP 8876)]
Attaching after fork to child process 8879.
Program received signal SIGSEGV, Segmentation fault.
[Switching to process 8879]
0x008d144c in Perl_newSVpv ()
from /usr/lib/perl5/5.8.6/i386-linux-thread-multi/CORE/libperl.so
#0 0x008d144c in Perl_newSVpv ()
from /usr/lib/perl5/5.8.6/i386-linux-thread-multi/CORE/libperl.so
#1 0x006bd906 in perl_trapd_handler (pdu=0x9f78e78,
transport=0xa0da378,
handler=0x9f7e690) at TrapReceiver.xs:81
#2 0x00ca1f2e in snmp_input (op=1, session=0xa0c6920, reqid=0,
pdu=0x9f799d0,
magic=0xa0da378) at snmptrapd_handlers.c:1088
#3 0x00d5a90c in _sess_process_packet (sessp=0xa0c7f90, sp=0xa0c6920,
isp=0xa0d3bf0, transport=0xa0da378, opaque=0x9f2cf38, olength=16,
packetptr=0xa0dc758 "0\202", length=132) at snmp_api.c:5276
#4 0x00d5d794 in _sess_read (sessp=0xa0c7f90, fdset=0xbf932d78)
at snmp_api.c:5675
#5 0x00d5e199 in snmp_sess_read (sessp=0xa0c7f90, fdset=0x0)
at snmp_api.c:5694
#6 0x00d5e1e9 in snmp_read (fdset=0xbf932d78) at snmp_api.c:5328
#7 0x0804c190 in ?? ()
#8 0xbf932d78 in ?? ()
#9 0x00000000 in ?? ()
The program is running. Exit anyway? (y or n)
Does anyone have any ideas as to what I'm doing wrong?
Neil Davidson
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users