On 29 February 2012 18:46, Ravi Kumar <mynets...@gmail.com> wrote:
> Can any one tell me how to implement nonVolatile(3)
> StorageType which keeps row permanent across reboots.

This makes use of the SNMP_CALLBACK_STORE_DATA callback,
and the snmpd_store_config() api call.


>       Can any one point me exact code snippet
> which implements this functionality(ie saving in stable storage).

The simplest example is probably the 'system_store' routine
(in agent/mibgroup/mibII/system_mib.c)
  This implements nonVolatile storage of three scalar objects
(rather than rows from a MIB table), but the basic idea is the same.

For examples of the same approach applied to MIB tables,
have a look at disman/mteObjectsTable.c (store_mteObjectsTable)
or notification/snmpNotifyTable.c (store_snmpNotifyTable)

Note that you'll also need the matching routine to read in these
saved config directives - see system_parse_config_*,
parse_mteObjectsTable or store_snmpNotifyTable respectively.

Dave

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to