Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

RFC: MRTG config file parsing, improved?

by Hercynium (Hermit)
on Jun 27, 2007 at 01:01 UTC ( [id://623520]=perlmeditation: print w/replies, xml ) Need Help??

Good afternoon!

I recently came to the Monks looking for wisdom in handling an ever-growing collection of MRTG config files... In the end, I could not find a solution with other people's code, so I wrote something new.

This is my first CPAN module, and I hope it will be useful to others. I especially hope I can get some feedback on improvements, features, bugs, etc. BTW, there's a bug in the globals() method - I just found it today :(

If you're wondering *why* this module might be useful... I'm currently using it to load, parse, and store to a DBM::Deep file the MRTG configs for over 450 routers, many of which have in excess of 1000 interfaces.

It completes this task in less than 5 min. on a modest P3-700Mhz/768MB/40GB-IDE server without exhausting the RAM.

Another script then uses the module to load the 'compiled' configs and generates an entire website complete with node indices, interface indices and summaries from data in the RRD files, and does this in about 35 min. (I did almost no optimization of this script - just changed the hash references from Tobi's structure to mine... however, the slowness may also be because the RRD files are stored on other servers over NFS.)

Please feel free to criticise, compliment, or otherwise offer any info that may help this be useful to people other than myself! Also... I have many other thoughts on trying to improve the state of SNMP programming and management using Perl. Is anybody else reading this interested in discussing it further?

Replies are listed 'Best First'.
Re: RFC: MRTG config file parsing, improved?
by Hercynium (Hermit) on Jul 03, 2007 at 14:36 UTC
    I hope it is not bad form to add a comment to my own meditation, but for anyone interested, I've updated this module a couple of times since posting this...

    The most notable improvements are not in the code, but in the documentation. I never got cozy with POD in the past... but I LIKE IT!!!

    I think I'll post something else about this later today...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://623520]
Approved by grinder
Front-paged by grinder
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-03-28 13:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found