Dynamic loadable module not working with compiled smpd V7.5.3
Jose Tornero <[email protected]> Fri, 5 Jul 2024 12:47:44 +0000
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <AS1PR08MB74996EC372F87AA566113513E3DF2@AS1PR08MB7499.eurprd08.prod.outlook.com> |
--===============8497589165989710712==
Content-Language: es-ES
Content-Type: multipart/alternative;
boundary="_000_AS1PR08MB74996EC372F87AA566113513E3DF2AS1PR08MB7499eurp_"
--_000_AS1PR08MB74996EC372F87AA566113513E3DF2AS1PR08MB7499eurp_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hello
I have a weird situation with a compiled snmpd V7.5.3 and not able to find =
out what's going on.
I have a linux system. At first instance I used the "official" snmpd (sudo =
apt-get install snmpd ... ) and added a reduced set of OIDs from an own MIB=
(with several scalar OIDs) in a dynamic loadable module following the step=
s of the corresponding tutorial. It worked fine. So far so good.
Next, I had to add more OIDs that belonged to a table. I followed the corre=
sponding steps to add the table and got it working. In this case, the funct=
ionality for that table was added as a subagent. So at this moment everythi=
ng was fine. But I realized that one OID from the table was an OCTET STRING=
which size was 65536 and in my case it only worked up to 1472 bytes. I inv=
estigated a little and I realized I had to recompile snmpd with that change=
.
I recompiled. The OID with big size worked perfectly well, with a big strin=
g (around 50000 bytes). But unfortunately (here comes the problem) the init=
ial scalar OIDs added by means of the dynamic loadable module didn't work: =
the response for a command snmpget is always "No Such Object available on t=
his agent at this OID".
More investigation and debugging. I see the following:
1. Function dlmod_load_module is called (dlmod.c)
2. Inside that function, function dl_init is called in turn
3. From my dynamic loadable module, the function init_... is called (I c=
hecked it adding it a return value and capturing it in function dlmod_load_=
module and showing by means of DEBUGMSGTL) but I don't see the log at the =
beginning of function init_... (I use "DEBUGMSGTL"). So this leads me to su=
spect there is some problem. I have investigated a lot but with no results =
...
Any ideas?
Thank you very much.
Jose.
--_000_AS1PR08MB74996EC372F87AA566113513E3DF2AS1PR08MB7499eurp_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Aptos",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
font-size:11.0pt;
font-family:"Aptos",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
span.EstiloCorreo17
{mso-style-type:personal-compose;
font-family:"Arial",sans-serif;
color:windowtext;
font-weight:normal;
font-style:normal;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:11.0pt;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1417286879;
mso-list-type:hybrid;
mso-list-template-ids:-1708479162 201981969 201981977 201981979 201981967 =
201981977 201981979 201981967 201981977 201981979;}
@list l0:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"ES" link=3D"#467886" vlink=3D"#96607D" style=3D"word-wrap:bre=
ak-word">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial",sans-serif">Hello<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial",sans-serif"><o:p> </o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif">I have a weird situation with a compil=
ed snmpd V7.5.3 and not able to find out what’s going on. <o:p>=
</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif">I have a linux system. At first instan=
ce I used the “official” snmpd (sudo apt-get install snmpd R=
30; ) and added a reduced set of OIDs from an own MIB (with several
scalar OIDs) in a dynamic loadable module following the steps of the corre=
sponding tutorial. It worked fine. So far so good.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif">Next, I had to add more OIDs that belo=
nged to a table. I followed the corresponding steps to add the table and go=
t it working. In this case, the functionality for
that table was added as a subagent. So at this moment everything was fine.=
But I realized that one OID from the table was an OCTET STRING which size =
was 65536 and in my case it only worked up to 1472 bytes. I investigated a =
little and I realized I had to recompile
snmpd with that change. <o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif">I recompiled. The OID with big size wo=
rked perfectly well, with a big string (around 50000 bytes). But unfortunat=
ely (here comes the problem) the initial scalar
OIDs added by means of the dynamic loadable module didn’t work: the =
response for a command snmpget is always “No Such Object available on=
this agent at this OID”.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif">More investigation and debugging. I se=
e the following:<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif"><o:p> </o:p></span></p>
<ol style=3D"margin-top:0cm" start=3D"1" type=3D"1">
<li class=3D"MsoListParagraph" style=3D"margin-left:0cm;mso-list:l0 level1 =
lfo1"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-family:"Aria=
l",sans-serif">Function dlmod_load_module is called (dlmod.c)<o:=
p></o:p></span></li><li class=3D"MsoListParagraph" style=3D"margin-left:0cm=
;mso-list:l0 level1 lfo1"><span lang=3D"EN-US" style=3D"font-size:10.0pt;fo=
nt-family:"Arial",sans-serif">Inside that function, function dl_i=
nit is called in turn<o:p></o:p></span></li><li class=3D"MsoListParagraph" =
style=3D"margin-left:0cm;mso-list:l0 level1 lfo1"><span lang=3D"EN-US" styl=
e=3D"font-size:10.0pt;font-family:"Arial",sans-serif">From my dyn=
amic loadable module, the function init_... is called (I checked it adding =
it a return value and
capturing it in function dlmod_load_module and showing by means of DEBUGMS=
GTL) but I don’t see the log at the beginning of function init_=
... (I use “DEBUGMSGTL”). So this leads me to suspect there is =
some problem. I have investigated a lot but with no results
… <o:p></o:p></span></li></ol>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif">Any ideas?
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif">Thank you very much.<o:p></o:p></span>=
</p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif">Jose.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:"Arial",sans-serif"><o:p> </o:p></span></p>
</div>
</body>
</html>
--_000_AS1PR08MB74996EC372F87AA566113513E3DF2AS1PR08MB7499eurp_--
--===============8497589165989710712==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============8497589165989710712==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
--===============8497589165989710712==--