--===============0072365296==
Content-Type: multipart/alternative;
boundary="----=_Part_1696_28915652.1205528075162"

------=_Part_1696_28915652.1205528075162
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Fri, Mar 14, 2008 at 9:47 AM, Nguyen Dinh Nam
wrote:

> I want to write an embedded Perl extension to replace the built in value
> of
> .iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifDescr.* ==
> .1.3.6.1.2.1.2.2.1.2 with my own values, such as the long description of the
> interface instead of interface name.
>
> I tried to register my own handler to .1.3.6.1.2.1.2.2.1.2 and make a
> $request->setValue(ASN_OCTET_STR, $long_description); but the result is not
> correct:
> $ snmpget -v 1 -c system localhost .1.3.6.1.2.1.2.2.1.2.5
> Error in packet
> Reason: (noSuchName) There is no such variable name in this MIB.
> Failed object: IF-MIB::ifDescr.5
>
> Please give me a hint on this problem, thank you
>
>

Thank you all, I have solved the bug.
The error
"No Such Object available on this agent at this OID" (-v 2c)
or
"Reason: (noSuchName) There is no such variable name in this MIB." (-v 1)
when writing extension in embedded Perl is caused by putting the embedded
Perl code in a different namespace (using package My::Name::Space

------=_Part_1696_28915652.1205528075162
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Fri, Mar 14, 2008 at 9:47 AM, Nguyen Dinh Nam <nguyendinhnam@gmail.com> wrote:

I want to write an embedded Perl extension to replace the built in value of
.iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifDescr.* == .1.3.6.1.2.1.2.2.1.2 with my own values, such as the long description of the interface instead of interface name.



I tried to register my own handler to .1.3.6.1.2.1.2.2.1.2 and make a $request->setValue(ASN_OCTET_STR, $long_description); but the result is not correct:
$ snmpget -v 1 -c system localhost .1.3.6.1.2.1.2.2.1.2.5


Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: IF-MIB::ifDescr.5

Please give me a hint on this problem, thank you



Thank you all, I have solved the bug.
The error
"No Such Object available on this agent at this OID" (-v 2c)
or
"Reason: (noSuchName) There is no such variable name in this MIB." (-v 1)

when writing extension in embedded Perl is caused by putting the embedded Perl code in a different namespace (using package My::Name::Space



------=_Part_1696_28915652.1205528075162--


--===============0072365296==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
--===============0072365296==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

--===============0072365296==--