Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with SNMP::Multi, or me!

1 view
Skip to first unread message

David Gethings

unread,
Jan 27, 2003, 12:09:35 PM1/27/03
to
Hi,

I'm writing a script that uses SNMP::Multi. Although I've had little
trouble with this PM in the past, in this instance I just cannot get a
sensible response when I use it.

It could very well be me, although after running things through the
debugger SNMP::Multi seems to recieve my data OK.

I generate the SNMP querie with the following code:

$request = SNMP::Multi::VarReq->new(hosts => [ $target ], vars => [
@vars ]);

$method = SNMP::Multi->new(Method => 'get',
MaxSessions => '32',
PduPacking => scalar(@vars),
Community => $community,
Version => '2c',
Timeout => '1',
Retries => '3');

$method->request($request) or die $method->error;
$queries{$target} = $method->execute() or die "Execute:
$SNMP::Multi::error\n";

An output of @vars is:

DB<2> x @vars
0 '.iso.org.dod.internet.private.enterprises.2352.3.1.1.1.1.3.46.201.35'
1 '.iso.org.dod.internet.private.enterprises.2352.3.1.1.1.1.3.21.101.35'
2 '.iso.org.dod.internet.private.enterprises.2352.3.1.1.1.1.4.21.201.35'
3 '.iso.org.dod.internet.experimental.9999.1.1.5.1.27.52'
4 '.iso.org.dod.internet.experimental.9999.1.1.5.1.27.777271'
5 '.iso.org.dod.internet.private.enterprises.2352.3.1.1.1.1.4.46.101.35'
6 '.iso.org.dod.internet.private.enterprises.2352.3.1.1.1.1.3.21.201.35'
7 '.iso.org.dod.internet.experimental.9999.1.1.5.1.27.63'
8 '.iso.org.dod.internet.experimental.9999.1.1.5.1.27.447633'
9 '.iso.org.dod.internet.private.enterprises.2352.3.1.1.1.1.3.46.101.35'
10 '.iso.org.dod.internet.private.enterprises.2352.3.1.1.1.1.4.46.201.35'
11 '.iso.org.dod.internet.private.enterprises.2352.3.1.1.1.1.4.21.101.35'
12 '.iso.org.dod.internet.experimental.9999.1.1.5.1.27.777304'
13 '.iso.org.dod.internet.experimental.9999.1.1.5.1.27.23590'


So @vars is a simple array of OIDs. When creating the
SNMP::Multi::VarReq object I've also tried 'vars => \@vars' syntax,
but the same problem happens.

The problem? In a nutshell the %queries object is filled with
malformed OIDs, as if they some how got munged together before/during
the actual SNMP query. The following output testifies this:

DB<2> x %queries
0 '62.241.161.251'
1 SNMP::Multi::Response=HASH(0x855c760)
'62.241.x.x' => SNMP::Multi::Response::Host=HASH(0x858f44c)
'hostname' => '62.241.x.x'
'results' => ARRAY(0x858f434)
0 SNMP::Multi::Result=HASH(0x858eed0)
'errind' => 0
'errnum' => 0
'errstr' => ''
'reqind' => 0
'varlist' => ARRAY(0x83e2b40)
0 SNMP::VarList=ARRAY(0x858e518)
0 SNMP::Varbind=ARRAY(0x855e0a8)
0
'.iso.org.dod.internet.private.enterprises.2352.3.1.1.1.1.3.46.201.35.0.0.0.0.0.0.2352.3.1.1.1.1.3.21.101.35'
1 ''
2 'NOSUCHINSTANCE'
3 'NOSUCHINSTANCE'

Any ideas what's causing this? Am I doing something wrong?

TIA

Dg

0 new messages