Saving/Loading MIB data


I am trying to save the entries in my MIB to the HDD and load them on startup but am struggling to get any of the saved MIB entries to load.

I am calling mib->save_all() at regular intervals, which is filling the directory I supplied in the constructor with files. However, when mib->init() is called on startup none of the entries are loaded from persistent storage.

I have tried initializing the MIB by adding the same entries as should be saved in the persistent mib (the one saved with save_all), expecting the entries to be populated with values loaded from persistent storage. This resulted in a MIB filled with the default values, rather than the updated values loaded from persistent storage.
I have also tried simply calling mib->init() without adding any entries to the mib prior to calling init, but this left me with an empty MIB without any of the entries loaded from persistent storage.

I have also attempted to use mib->save and mib->load (with no success) but am unsure what should be passed as the format since I don’t see any defined formats or any examples to show how this should be done.

Can you please clarify how the MIB should be saved to and loaded from persistent storage, and anything I might have missed.

Thanks in advance!

Have you set the Mib::set_persistent_objects_path correctly?

I’m fairly sure I have, I could be wrong though…

I created the Mib by passing the path to the constructor:

mib = new Mib(“/root/MIBs/”);

and have also tried:

mib->set_persistent_objects_path(new OctetStr(“/root/MIBs/”));