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