[prev in list] [next in list] [prev in thread] [next in thread] 

List:       net-snmp-users
Subject:    Re: what is right place to load subagent configuration
From:       Андрей Лоб <nekulturist () gmail ! com>
Date:       2024-05-07 12:45:58
Message-ID: CALs6EaXy0_Zo_30K7VheUDE4uocCqS=QZb7GKu5SoUGUNkdByQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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.

вт, 7 мая 2024 г. в 15:17, Андрей Лобов <nekulturist@gmail.com>:

> And another related question - how to hook on agent shutdown in order to
> properly release the resources.
>
> Thanks,
> Andrey
>
> пн, 6 мая 2024 г. в 18:03, Андрей Лобов <nekulturist@gmail.com>:
>
>> 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 config
>> 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
>>
>

[Attachment #5 (text/html)]

<div dir="ltr">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.<div>Thanks, the question is \
closed.</div></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">вт, 7 мая 2024 г. в 15:17, Андрей Лобов &lt;<a \
href="mailto:nekulturist@gmail.com">nekulturist@gmail.com</a>&gt;:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr">And another related question - how \
to hook on agent shutdown in order to properly release the \
resources.<div><br></div><div>Thanks,</div><div>Andrey</div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">пн, 6 мая 2024 г. в \
18:03, Андрей Лобов &lt;<a href="mailto:nekulturist@gmail.com" \
target="_blank">nekulturist@gmail.com</a>&gt;:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr">He everyone,<div><br></div><div>I \
write subagent, referring to the guide  <a \
href="http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_Subagent" \
target="_blank">http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_Subagent</a>  \
</div><div>So far so good - 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  I 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 \
advance</div><div><br></div><div>Regards,</div><div>Andrey</div></div> \
</blockquote></div> </blockquote></div>





_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic