This is a discussion on Re: [AMaViS-user] Don't reset snmp.db at startup ? within the Amavis User forums, part of the Anti-Spam and Anti-Virus Related Forums category; Herold, > I was wondering why snmp.db is reset at startup... is there some real need > for that (...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Herold,
> I was wondering why snmp.db is reset at startup... is there some real need > for that (perhaps internal statistics, counters growing too much or > something like that) ? No real need to reset, one can keep these databases persistent. The only reason for a reset was to make life easier in case of database upgrades (db compatibility) and in cases of a database corruption/recovery. > I'm pulling some of that data straight out of the db with an simple > evolution of amavisd-agent, and dump it into mrtg, and I'd like not having > at least counters like InMsgs restarted at every configuration tweak > (counters would still wrap at some time but I can live with that). > > I didn't find support for this and I'm not familiar with BerkelyDB... I > suppose changes would have to been made either in child_init_hook() or > directly in Amavis::DB::SNMP->new() ? > Hmmm I see in that db is child process data, too, this means just keeping > the old db instead of creating a new one could be harmfull, since at least > that selected data should be initialized freshly every time ? The key code is in: package Amavis::DB; .... # create new databases, then close them (called by the parent process) # (called only if $db_home is nonempty) sub init($) { my($predelete) = @_; # delete existing db files first? So changing Amavis::DB::init(1) into Amavis::DB::init(0) in sub pre_loop_hook is supposed to work. I haven't tried it recently, but earlier versions were happy one way or the other. Mark ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click _______________________________________________ AMaViS-user mailing list AMaViS-user@lists.sourceforge.net https://lists.sourceforge.net/lists/...fo/amavis-user AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 AMaViS-HowTos:http://www.amavis.org/howto/ |