Persistence of MIB data

Frank Fock Frank.Fock____t-online.de
Tue Feb 26 00:58:52 CET 2002


Hi Ram,

I think the difference between running your agent from console and
as service is the working directory for the agent. By default AGENT++
saves its configuration to the config directory below its working
directory.

There are currently no methods defined to control the persistency on
a fine granularity. I will add such methods for the next release. Nevertheless,
you can subclass Mib and overwrite Mib::add and Mib::add_context to
add your subclass of MibContext instead of MibContext directly. Then
you can control persistency within MibContext by overwriting
MibContext::save_to().

Deactivating persistency on exit is currently not supported, but I will add
this for the next release too. You only can disable it at all by providing
an invalid directory when creating the Mib instance.

Hope this helps.

Best regards,
Frank

Ram Krishnaswamy wrote:

> Hello,
>
> I had asked this question before and did not get any reply. I would
> appreciate if somebody could answer it as it might help me save some time
> instead of digging through the code.
>
> I am using the latest snmp++, agent++ libraries on windows. I have built an
> agent that is running a service. If I run in this mode, then all data in
> tables get written to their respective modules in c:\winnt\system32\config
> directory on exit of the agent. But the data is NOT updated if the agent is
> run as a non-service on a console window!!! I call the same
> initializationcode, in terms of SNMP, for both. The only difference is one
> turns the application into a service and passes a service handler routine
> and the other one starts the agent on the command line.
>
> If I have to turn off persistence of mib data on exit, either individually
> by module or as a whole, how would I do it? This is creating some problems
> for me when the agent comes back. I sometimes see old values from a previous
> run.
>
> Thank you very much.
>
> Ram Krishnaswamy
> ramk at pathfire.com





More information about the AGENTPP mailing list