> > > 1) Have you built your genertated template OK using mib2c? yes/no > > > > 2) If yes you should see an initialization function being generated. At > the > > end of this function you should add the following: > > > > /* Create the token handler */ > > snmpd_register_config_handler(token,system_parse_config); > > > > /* Register the function to write to persistence */ > > > > > snmp_register_callback(SNMP_CALLBACK_LIBRARY,SNMP_CALLBACK_STORE_DATA,global > > _store_func,NULL); > > > > global_store_func() is your function that you have created to write > to > > persistence. > > > > 3) When global store is called it will write whatever data you want and > > place the contents in /var/net-snmpd/snmpd.conf > > 4) When you perform a set operation the set_action func is called which > > adds your set to the mib tree and following that the commit action is > > called. Within this commit func() is where you will make the decision on > > whether to commit the set data to persistence hence a COMMIT flag could be > > used or maybe the MSB of the field could be used of the oid value you wish > > to add into persistence. > > This is when you will copy the contents of the set request to local data > > structure which could be used in the global_store_func() to push that data > > into persistence. > > 5) Note the data you write to persistence is in the format: > > token value > > 6) When you restart your agent again the function system_parse_config > will > > be called which will identify the token you have put into persistence. In > my > > example I recreate the oid again from the persistence and rebuild the mib > > tree. > > > > 7) See the example system_mib.c under the mibgroup/mibII directory that > > should give you an idea of how to do this. > > > > Cheers, > > Garyc > > ----- Original Message ----- > > From: <[EMAIL PROTECTED]> > > To: "Gary Clark" <[EMAIL PROTECTED]> > > Cc: <[EMAIL PROTECTED]> > > Sent: Monday, August 30, 2004 4:12 PM > > Subject: Re: Saving persistent values *now* > > > > > > > (I've read this 3 times but I guess it's been a long day 'cuz it doesn't > > make sense to me.) > > > > > > > Ok what I do is keep a local copy > > > > > > Local to what function? Where? > > > > > > > of the set request data in an array. This > > > > could easily be a linked list of objects. When a set request is > > > > made I check > > > > a COMMIT flags in my MIB to see if that is set. If it is set when > > > > the commit > > > > function gets called (following the set action) I then pack the > > > > contents of > > > > the row into a message. This message is then parsed and columns > > > > extractedand pushed into a > > > > linked list/ vector. The store function is called and writes the > > > > linked list > > > > into persistence. By doing this updates to persistence are passed > > > > to the > > > > user and not when the agent is killed. Make sence? > > > > > > It sounds like you're talking about adding a row to a table. I'm > > updating, not adding, and I'm doing one value on each of several rows. > But > > however it's done, my question is how do I force persistent values to be > > stored when set? Can I safely and reasonably call the callback I > registered > > to save on shutdown? Since I don't use any of the values it gets passed, > > can I call > > > > > > mySaveFunc(0, 0, NULL, NULL); > > > > > > ? > > > > > > Chris > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by BEA Weblogic Workshop > > > FREE Java Enterprise J2EE developer tools! > > > Get your free copy of BEA WebLogic Workshop 8.1 today. > > > http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click > > > _______________________________________________ > > > 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 > > >
------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click _______________________________________________ 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