On wtorek, 25 marca 2008, G. S. Marzot wrote:
> [EMAIL PROTECTED] wrote:
> > On poniedziaƂek, 24 marca 2008 you wrote:
> >> [EMAIL PROTECTED] wrote:
> >>> Hi
> >>>
> >>> I`m having problems with the SNMP.pm Perl module for Net-SNMP.
> >>> I`m trying to use the gettable() function to retrieve a table
> >>> using the following perl code:
> >>
> >> This should work but here is one thing to try. Leave out the:
> >>
> >>                   UseSprintValue => 1
> >>
> >> This flag causes the perl module to use the library's value
> >> sprinting code...
> >>
> >> I would be surprised if it did not resolve enumerations to
> >> symbolic labels but I haven't looked at that code in a while.
> >>
> >> Can you post if the behaviour changes with that flag removed?
> >
> > Removing this flag doesn`t change the output. However, I`ve
> > discovered, that adding the noindexes option to the gettable call
> > does:
> >
> >           '1.167806987.1' => {
> >                               
> > 'gponGponPmObjectHistEntryAvail24Hrs' => '1',
> >                                'gponGponPmObjectEndpoint' => 'ont',
> >                               
> > 'gponGponPmObjectHistEntryAvail15Min' => '96',
> >                                'gponGponPmObjectThreshPointer' =>
> > '1', 'gponGponPmObjectType' => 'gemPort',
> > 'gponGponPmObjectTypeIndex' => '167806987',
> >                                'gponGponPmObjectHistEntrySize24Hrs'
> > => '1',
> >                                'gponGponPmObjectIndex' => '15',
> >                                'gponGponPmObjectHistEntrySize15Min'
> > => '96',
> >                                'gponGponPmObjectAdminState15Min'
> > => 'unlock',
> >                                'gponGponPmObjectAdminState24Hrs'
> > => 'unlock'
> >                              }
> >
> > I`ve tried to dig through the SNMP.pm code to find the cause and
> > noticed, that without 'noindexes => 1' the fields alredy resolved
> > to 'gemPort', 'ont' are overwritten with plain integers from the
> > index hash key. Unfortunately I couldn`t figure out why the index
> > hash key values are not properly mapped to enums.
>
> it is in the function _gettable_end_routine() and this code in
> particular
>
>           for ($i = 0; $i <= $#indexes; $i++) {
>               $state->{'result_hash'}{$trow}{$indexes[$i]} = $nindexes->[$i];
>           }
>
> hopefully the person who implemented gettable() is listening and can
> comment.
>
> if the workaround of setting 'noindexes' is adequate I'd go with
> that...is it?

For my application it`s sufficient. I think the noindexes quirk should 
be documented, so that future users won`t fall into this trap.
But it`s still a hack more than a solution. If the person who wrote 
gettable() reads this maybe he will find a better fix.

-- 
Maciej Grela


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to