SnmpTargetMib and NotificationMib persistance

Frank Fock Frank.Fock____t-online.de
Fri Aug 10 00:51:58 CEST 2001


Hi Rob,

Please find my comments inline:

"Adelberg, Robert (RADELBER)" wrote:

> Hi,
>
> When my agent starts, I need it to read in the SnmpTarget-MIB and
> Notification-MIB info from persistent storage and save them to file whenever
> the MIBs change.
>
> Do I manually have to tell the SNMPTarget-MIB to load_from_file() at startup
> or is it
> handle automatically?
>

This is not needed. Calling the Mib::init() is sufficient.

>
> Likewise, do I have use save_to_file() everytime I notice the MIB table has
> changed?

Deleting the Mib instance will also store all data to disk. So the above
is not needed, but it is in some way more save.

>
>
> How and where (in my agent) should I go about doing this?
>

Call Mib::init() before the main loop. Catch termination signals
in the main loop. Wait after main loop until all threads terminated
(thus, the request list is empty) and then call "delete myMib".

When you want to save data during runtime, then you can call
Mib::save_all() from the main loop.

Best regards,
Frank




More information about the AGENTPP mailing list