[AGENT++] Proposal: Explicit save of persistent objects via SNMP

Henning Eggers henning.eggers at plath.de
Wed Oct 6 11:43:53 CEST 2004


Hi,
the Mib class has a method called "save_all()" which saves all persitent
data to the persitent dir. The agent itself only saves them in the
destructor which is reasonable. But most agents (ours at least) run "for
ever" and only terminate if the system crashes. So persitent data, most
importantly changes to the USM and TargetMib tables won't get changed and
have to be reentered after a crash.

I suggest an interface in the agentpp_config_mib (or a sibling) to force a
save (a call to save_all()). This should include the following objects:
- The persistent path (read/write), although writing to this would only make
sense if this information was stored somewhere else on the disk (config
file, registry, etc. ). Another use might be to store a backup copy of the
current values.
- The TimeStamp of the last save (readonly), just to be reassured that
something happend.
- The TimeStamp of the last read (readonly), to see if the values have been
reset.
- The action object, an enum (read/write): noAction(1), saveAll(2),
readAll(3), setting which would result in the respective action. Reading
would effectively be resetting the data to its boot-up values (if the path
was not changed).

The resulting MibGroup object would need a backreference to the Mib object
to which it was added in order to be able to call save_all(), read_all()
(which is now part of init()) and get_persistent_objects_path(). A
set_persistent_objects_path() would still need to be implemented.

I have already started a little work on this but consequently thought that
this might be of general use and be better placed in a more general MIB or
even its own MIB in the agentpp tree.
Also I wanted to check if this may actually be already implemented
somewhere.

Thanks,
Henning





More information about the AGENTPP mailing list