You have to implement the "save" and "load" persistent data.  If using the
mfd mib2c system, for example, you can answer:

This table has writable columns. Do you want to generate
code for writeable columns, or restrict the table to read-only?

  1) generate code with writeable columns [DEFAULT]
  2) generate code with read-only columns

Select your choice : *1*

and then:

Since your table is writable, do you want to generate code to save and
restore rows in the Net-SNMP persistent store? You should only use this
option if the agent 'owns' the data, and doesn't get the data from an
external source.

  1) do not generate persistent store code [DEFAULT]
  2) generate persistent store code

Select your choice : *2*

and then implement the _<table>_container_row_restore and
_<table>_container_save_rows functions in <table>_interface.c.

If you are not using mfd, then during module initialization, use
register_config_handler() to register a function that will parse a
persistent storage file line with the data you wrote, and use
snmp_register_callback(
SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA, ... ) to register a
function that will save your data to the persistent file.

  Bill


On Tue, Apr 25, 2017 at 12:40 AM, deepak.sachan deepak.sachan <
deepak.sac...@deal.drdo.in> wrote:

>
> Hi
>
> I have tried communicating b/w agent and client using dynamic module (.so)
>  creation for snmp agent.
> snmpget and snmpset working fine . But if restart the agent ,oid value
> doesnt change . it shows the  previous value which has been defined in .c
> file.
>
> Any help ?????
>
> Thanks in advance.
>
>
>
> Regards Deepak
>
>
> The contents of this Email communication are confidential to the
> addressee. If you
> are not the intended recipient you may not disclose or distribute this
> communication
> in any form should immediately contact the sender. The information,
> images, documents
> and views expressed in this Email are personal to the Sender and do not
> expressly or
> implicitly represent official positions of DRDO and no authority exists on
> behalf of
> DRDO to make any agreements, or other binding commitment by means of Email.
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Net-snmp-coders mailing list
> Net-snmp-coders@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to