[mrtg] Re: Reading config files -- FAST
Bjorn Nordbo
bn at nextra.com
Wed Sep 13 10:07:10 MEST 2000
Rainer Bawidamann wrote:
>
> In article <20000912135921.H297 at nextra.com>,
> bn at nextra.com (Bjorn Nordbo) writes:
> > however this routine misses line continuation:
>
> What about not using line continuation? It's your config file!
> (of course that might give you very long lines)
I'm too pedantic. :)
> > 2. Extract every target config to another medium than one big, flat file
> > and write a config backend to read that for the display scripts.
> > 3. As for (2), but use this backend for MRTG (2.9) too.
>
> aka 'config cache':
>
> a. You could store the complete perl structures with Storable.pm (or
> Data::Dumper but Storable is much faster).
> b. Change mrtg/MRTG_lib so every access to configuration is done thru a
> function/method. These functions can get the config from a dbm file
> or sql database ... (or tie - but the config structures are not
> simple hashes but hashes of hashes of ...)
I settled for this solution using MLDBM with DB_File and Storable.
As I generate the large configs every third hour, it is easy for me
to read and parse them, and store them into a DB. The display script
will check if the config has a matching DB which is newer, if yes
use the DB, if no parse the config as before.
If you want, I could mail you the results for configs on about 500
targets once I get the system up and running.
Thanks for your help!
--
Bjørn Nordbø - IP Development - Nextra Norway
--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive http://www.ee.ethz.ch/~slist/mrtg
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the mrtg
mailing list