[Pkg-net-snmp-devel] Bug#495060: Bug#495060: Bug#495060: net-snmp: embedding perl needs PERL_SYS_INIT3()

Jochen Friedrich jochen at scram.de
Fri Aug 22 14:23:08 UTC 2008


Hi Niko,

> If you can give a straightforward recipe for testing the perl support,
> I'm sure people on debian-hppa list can help.

Here is another straightforward recipe taken almost verbatim from the snmpd.conf man page:

1. Place this config file as /etc/snmp/snmpd.conf.test:

--------------------------->8--------------------------------
com2sec readonly  default    public
group   MyROGroup v1         readonly
view    all       included   .1        80
access  MyROGroup ""         any       noauth    exact  all    none   none
perl use Data::Dumper;
perl sub myroutine  { print "got called: ",Dumper(@_),"\n"; }
perl $agent->register('mylink', '.1.3.6.1.8765', \&myroutine);
--------------------------->8--------------------------------

2. Stop snmpd:

# /etc/init.d/snmpd stop

3. Manually start snmpd:

# snmpd -f -C -c /etc/snmp/snmpd.conf.test -lo
Warning: -l option is deprecated, use -Lf <file> instead

4. On a second console, query the MIB registered by perl:

# snmpget -v 1 -c public 127.0.0.1 .1.3.6.1.8765
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: SNMPv2-SMI::internet.8765

5. On the first console, snmpd should have printed some perl output:

got called: $VAR1 = bless( do{\(my $o = 162448928)}, 'NetSNMP::agent::netsnmp_mib_handler' );
$VAR2 = bless( do{\(my $o = 162391808)}, 'NetSNMP::agent::reginfo' );
$VAR3 = bless( do{\(my $o = 162486872)}, 'NetSNMP::agent::netsnmp_agent_request_info' );
$VAR4 = bless( do{\(my $o = 162707656)}, 'NetSNMP::agent::netsnmp_request_infoPtr' );

Thanks,
Jochen





More information about the Pkg-net-snmp-devel mailing list