This is a multi-part message in MIME format.

--===============0394706887==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0003_01C8A3A7.CCEF4D40"

This is a multi-part message in MIME format.

------=_NextPart_000_0003_01C8A3A7.CCEF4D40
Content-Type: text/plain;
charset="big5"
Content-Transfer-Encoding: quoted-printable

Hi,

I want to write a dynamically loadable object.
I downloaded the example (including: Makefile, NET-SNMP-TUTORIAL-MIB.txt, n=
stAgentPluginObject.h, nstAgentPluginObject.c) from net-snmp offical websit=
e.
I did it step by step as following:

Steps to test the shared object via runtime MIB configuration=20
1.. Start the snmpd and watch the dlmod and nstAgentPluginObject modules =
interact using the debugging flag (this assumes you already have access con=
trol set up properly for your agent):=20
% snmpd -f -L -DnstAgentPluginObject,dlmod=20
2.. In another window, test to make sure that the agent doesn't currently=
support the nstAgentPluginObject (if you get different results running thi=
s command you need to recompile the net-snmp agent without the nstAgentPlug=
inObject mib module compiled in directly):=20
% snmpget localhost NET-SNMP-TUTORIAL-MIB::nstAgentPluginObject.0=20
nstAgentPluginObject.0 =3D No Such Object available on this agent at th=
is OID=20
3.. Then, run snmpset to create a new row in the dlmod table:=20
% snmpset localhost UCD-DLMOD-MIB::dlmodStatus.1 i create=20
dlmodStatus.1 =3D create(6)=20
4.. See that the row was created:=20
% snmptable localhost UCD-DLMOD-MIB::dlmodTable=20
SNMP table: dlmodTable=20
dlmodName dlmodPath dlmodError dlmodStatus=20
unloaded=20
5.. Then set the properties of the row up to point to our new object and =
to give it a name:=20
% snmpset localhost UCD-DLMOD-MIB::dlmodName.1 s "nstAgentPluginObject"=
UCD-DLMOD-MIB::dlmodPath.1 s "/path/to/nstAgentPluginObject.so"=20
dlmodName.1 =3D "nstAgentPluginObject"=20
dlmodName.1 =3D "/path/to/nstAgentPluginObject.so"=20
% snmptable localhost UCD-DLMOD-MIB::dlmodTable=20
SNMP table: dlmodTable=20
dlmodName dlmodPath dlmodError dlmodStatus=20
nstAgentPluginObject /path/to/nstAgentPluginObject.so unloaded=20
6.. Finally, load the shared object into the running agent:=20
% snmpset localhost UCD-DLMOD-MIB::dlmodStatus.1 i load=20
dlmodStatus.1 =3D loaded(1)=20
% snmptable localhost UCD-DLMOD-MIB::dlmodTable=20
SNMP table: dlmodTable=20
dlmodName dlmodPath dlmodError dlmodStatus=20
nstAgentPluginObject /path/to/nstAgentPluginObject.so loaded=20
7.. If everything above was done correctly, then the following command sh=
ould work and will access the shared object's data:=20
% snmpget localhost NET-SNMP-TUTORIAL-MIB::nstAgentPluginObject.0=20
nstAgentPluginObject.0 =3D INTEGER: 3=20


But I got an error in step 6. It showed "SNMP table: UCD-DLMOD-MIB::dlmodTa=
ble

dlmodName dlmodPath=
=
dlmodError dlmodStatus
nstAgentModuleObject /home/net-snmp-module-example/nstAgentModuleObject.so=
dlopen failed: /home/net-snmp-module-example/nstAgentModuleObject.so: unde=
fined symbol: snmp_get_do_debugging error
".

I tried hard to find some disscussion about this, but I couldn't find a sol=
ution.
Could you help me to resolve this problem? What's wrong with my steps? Or t=
here is something important I missed? Thanks a lot!!!


Sincerely,


iTAS Tewen
--=20
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


------=_NextPart_000_0003_01C8A3A7.CCEF4D40
Content-Type: text/html;
charset="big5"
Content-Transfer-Encoding: quoted-printable








Hi,

 

I want to write a dynamically loadable=20
object.

I downloaded the example (including: al text"=20
title=3Dhttp://www.net-snmp.org/tutorial/tutorial-5/toolkit/demoapp/Makefil=
e=20
href=3D"http://www.net-snmp.org/tutorial/tutorial-5/toolkit/demoapp/Makefil=
e"=20
rel=3Dnofollow>Makefile
, t"=20
title=3Dhttp://www.net-snmp.org/tutorial/tutorial-5/toolkit/mib_module/NET-=
SNMP-TUTORIAL-MIB.txt=20
href=3D"http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mib_module/NET-=
SNMP-TUTORIAL-MIB.txt"=20
rel=3Dnofollow>NET-SNMP-TUTORIAL-MIB.txt
, class=3D"external text"=20
title=3Dhttp://www.net-snmp.org/tutorial/tutorial-5/toolkit/dlmod/nstAgentP=
luginObject.h=20
href=3D"http://www.net-snmp.org/tutorial/tutorial-5/toolkit/dlmod/nstAgentP=
luginObject.h"=20
rel=3Dnofollow>nstAgentPluginObject.h, class=3D"external text"=20
title=3Dhttp://www.net-snmp.org/tutorial/tutorial-5/toolkit/dlmod/nstAgentP=
luginObject.c=20
href=3D"http://www.net-snmp.org/tutorial/tutorial-5/toolkit/dlmod/nstAgentP=
luginObject.c"=20
rel=3Dnofollow>nstAgentPluginObject.c) from net-s=
nmp=20
offical website.

I  did it step by step as following:

 

Steps to test the shared object via runtime MIB configuration



  1. Start the snmpd and watch the dlmod and nstAgentPluginObject modules=
    =20
    interact using the debugging flag (this assumes you already have access=
    =20
    control set up properly for your agent):=20

    % snmpd -f -L -DnstAgentPluginObject,dlmod

  2. In another window, test to make sure that the agent doesn't currently=
    =20
    support the nstAgentPluginObject (if you get different results running th=
    is=20
    command you need to recompile the net-snmp agent without the=20
    nstAgentPluginObject mib module compiled in directly):=20

    % snmpget localhost NET-SNMP-TUTORIAL-MIB::nstAgentPluginObject.=
    0
    =20

    nstAgentPluginObject.0 =3D No Such Object available on this agent a=
    t this=20
    OID

  3. Then, run snmpset to create a new row in the dlmod table:=20

    % snmpset localhost UCD-DLMOD-MIB::dlmodStatus.1 i create=20
    dlmodStatus.1 =3D create(6)

  4. See that the row was created:=20

    % snmptable localhost UCD-DLMOD-MIB::dlmodTable
    SNMP table: dlmodTable=20

    dlmodName dlmodPath dlmodError dlmodStatus=20
    unloaded

  5. Then set the properties of the row up to point to our new object and =
    to=20
    give it a name:=20

    % snmpset localhost UCD-DLMOD-MIB::dlmodName.1 s=20
    "nstAgentPluginObject" UCD-DLMOD-MIB::dlmodPath.1 s=20
    "/path/to/nstAgentPluginObject.so"

    dlmodName.1 =3D "nstAgentPluginObject"=20
    dlmodName.1 =3D "/path/to/nstAgentPluginObject.so"=20

    % snmptable localhost UCD-DLMOD-MIB::dlmodTable
    SNMP table: dlmodTable=20

    dlmodName dlmodPath dlmodError dlmodStatus=20
    nstAgentPluginObject /path/to/nstAgentPluginObject.so unloaded
    >

  6. Finally, load the shared object into the running agent:=20

    % snmpset localhost UCD-DLMOD-MIB::dlmodStatus.1 i load
    dlmodStatus.1 =3D loaded(1)=20

    % snmptable localhost UCD-DLMOD-MIB::dlmodTable=20
    SNMP table: dlmodTable=20

    dlmodName dlmodPath dlmodError dlmodStatus=20
    nstAgentPluginObject /path/to/nstAgentPluginObject.so loaded
    <=
    /DL>
  7. If everything above was done correctly, then the following command sh=
    ould=20
    work and will access the shared object's data:


  8. % snmpget localhost NET-SNMP-TUTORIAL-MIB::nstAgentPluginObject.=
    0=20

    nstAgentPluginObject.0 =3D INTEGER: 3

 

 

But I got an error in step 6. It showed "SNMP table:=20
UCD-DLMOD-MIB::dlmodTable

 

           =20
dlmodName           =
            &nb=
sp;            =
        =20
dlmodPath           =
            &nb=
sp;            =
            &nb=
sp;            =
            &nb=
sp;            =
            &nb=
sp;=20
dlmodError dlmodStatus
 nstAgentModuleObject=20
/home/net-snmp-module-example/nstAgentModuleObject.so dlopen failed:=20
/home/net-snmp-module-example/nstAgentModuleObject.so: undefined symbol:=20
snmp_get_do_debugging       error
".

 

I tried hard to find some disscussion about this, but I=
=20
couldn't find a solution.

Could you help me to resolve this problem? What's wrong=
with=20
my steps? Or there is something important I missed? Thanks a lot!!!
<=
/DIV>
 

 

Sincerely,

 

 

iTAS Tewen

--=20

This message has been scanned for viruses and

dangerous content by
MailScanner, and is

believed to be clean.


------=_NextPart_000_0003_01C8A3A7.CCEF4D40--



--===============0394706887==
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 the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757...un.com/javaone
--===============0394706887==
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

--===============0394706887==--