Re: what is right place to load subagent configuration

Андрей Лобов <[email protected]> Tue, 7 May 2024 15:45:58 +0300
Newsgroups gmane.network.net-snmp.user
Message-ID <CALs6EaXy0_Zo_30K7VheUDE4uocCqS=QZb7GKu5SoUGUNkdByQ@mail.gmail.com>
--===============6869636242597499686==
Content-Type: multipart/alternative; boundary="00000000000003e23b0617dc9202"

--00000000000003e23b0617dc9202
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I was able to catch the temporary file generated by net-snmp-config
and learnt from it that I can just write manually init_MyModuleName and
shutdown_MyModuleName functions and should be good.
Thanks, the question is closed.

=D0=B2=D1=82, 7 =D0=BC=D0=B0=D1=8F 2024=E2=80=AF=D0=B3. =D0=B2 15:17, =D0=
=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9 =D0=9B=D0=BE=D0=B1=D0=BE=D0=B2 <nekulturi=
[email protected]>:

> And another related question - how to hook on agent shutdown in order to
> properly release the resources.
>
> Thanks,
> Andrey
>
> =D0=BF=D0=BD, 6 =D0=BC=D0=B0=D1=8F 2024=E2=80=AF=D0=B3. =D0=B2 18:03, =D0=
=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9 =D0=9B=D0=BE=D0=B1=D0=BE=D0=B2 <nekulturi=
[email protected]>:
>
>> He everyone,
>>
>> I write subagent, referring to the guide
>> http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_Subagent
>> So far so good - I'm able to get the simple scalar metric.
>> Now I need to use some parameters, which should be loaded from
>> configuration files.
>> From what I got I need to use register_config_handler, but what I do not
>> quite get - what should be the right place to call it and when the confi=
g
>> file will actually be read, as I need to make sure somehow I've got all =
the
>> parameters at the agent startup.
>> Is the same Netsnmp_Node_Handler function OK to use or are there any
>> other handlers I could use to hook on agent initialization?
>>
>> Thank you in advance
>>
>> Regards,
>> Andrey
>>
>

--00000000000003e23b0617dc9202
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I was able to catch the temporary file generated by net-sn=
mp-config and=C2=A0learnt from it that I can just write manually init_MyMod=
uleName and shutdown_MyModuleName functions and should be good.<div>Thanks,=
 the question is closed.</div></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">=D0=B2=D1=82, 7 =D0=BC=D0=B0=D1=8F 2024=E2=80=
=AF=D0=B3. =D0=B2 15:17, =D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9 =D0=9B=D0=BE=
=D0=B1=D0=BE=D0=B2 &lt;<a href=3D"mailto:[email protected]">nekulturist=
@gmail.com</a>&gt;:<br></div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex"><div dir=3D"ltr">And another related question - how to hook on agent sh=
utdown in order to properly release the resources.<div><br></div><div>Thank=
s,</div><div>Andrey</div></div><br><div class=3D"gmail_quote"><div dir=3D"l=
tr" class=3D"gmail_attr">=D0=BF=D0=BD, 6 =D0=BC=D0=B0=D1=8F 2024=E2=80=AF=
=D0=B3. =D0=B2 18:03, =D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9 =D0=9B=D0=BE=D0=
=B1=D0=BE=D0=B2 &lt;<a href=3D"mailto:[email protected]" target=3D"_bla=
nk">[email protected]</a>&gt;:<br></div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)=
;padding-left:1ex"><div dir=3D"ltr">He everyone,<div><br></div><div>I write=
 subagent, referring to the guide=C2=A0<a href=3D"http://www.net-snmp.org/w=
iki/index.php/TUT:Writing_a_Subagent" target=3D"_blank">http://www.net-snmp=
.org/wiki/index.php/TUT:Writing_a_Subagent</a>=C2=A0</div><div>So far so go=
od - I&#39;m able to get the simple scalar metric.</div><div>Now I need to =
use some parameters, which should be loaded from configuration files.</div>=
<div>From what I got I need to use register_config_handler, but what=C2=A0I=
 do not quite get - what should be the right place to call it and when the =
config file will actually be read, as I need to make sure somehow I&#39;ve =
got all the parameters at the agent startup.</div><div>Is the same Netsnmp_=
Node_Handler function OK to use or are there any other handlers I could use=
 to hook on agent initialization?</div><div><br></div><div>Thank you in adv=
ance</div><div><br></div><div>Regards,</div><div>Andrey</div></div>
</blockquote></div>
</blockquote></div>

--00000000000003e23b0617dc9202--


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


--===============6869636242597499686==
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

--===============6869636242597499686==--