> > What exactly are you trying to do? > > While shutting down the agent I am reading SNMP configurations from the > database and generating SNMP configuration file (snmpd.conf), that can > be read by the agent during the next start-up. Currently I am harding > coding the SNMP configuraiton filename as "/deveconf/snmp/snmd.conf".
Hmmm.... That's a slightly unusual approach, but it should work OK. But hardcoding the name of the config file isn't sensible as a general solution (though it's fair enough while testing). You'd probably be better off using the "standard" persistent config file. Either calculate this using something like sprintf(config_file, "%s/%s.conf", get_persistent_directory(), netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_APPTYPE)); or (better) use the API routine read_app_config_store() to save each line. This can either be done directly, or (better) linked into the automatic shutdown mechanism: snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA, store_from_database, NULL); (where 'store_from_database' is the routine to save the config lines). There are a number of examples of this in the current agent - look for where the SNMP_CALLBACK_STORE_DATA callback is registered. Dave ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ 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