[mrtg] Re: MRTG log file parsing

William Owen william.owen at profilesmail.com
Tue Dec 13 18:06:08 MET 2005


I use a VBScript to read config information from a database and launch MRTG
with various levels of logging turned on.  The script then parses the STDOUT
and STDERR produced by MRTG to determine if something failed and then takes
action (action is currently logging to a text file but could be anything).
Although my implementation is simple, you should be able to take the same
idea, extend it and have it do whatever you need.

-----Original Message-----
From: Ruttenberg, Tanya [mailto:Tanya.Ruttenberg at ssa.gov] 
Sent: Tuesday, December 13, 2005 8:15 AM
To: 'Steve Shipway'; mrtg at list.ee.ethz.ch
Subject: [mrtg] Re: MRTG log file parsing

I already use rrdtool to store data.  But how is that going to tell me if a
target can't be evaluated because there was no response vs. a bogus target
name?  I'm not talking about reports on the data, I'm talking about reports
on failed attempts to get data from targets.

-----Original Message-----
From: Steve Shipway [mailto:s.shipway at auckland.ac.nz] 
Sent: Monday, December 12, 2005 4:39 PM
To: 'Ruttenberg, Tanya'; mrtg at list.ee.ethz.ch
Subject: RE: [mrtg] Re: MRTG log file parsing


> "parsing the MRTG log file AND writing a report based on the contents" 
> is what I really meant to say.
> 
> Kind of like awstats for MRTG if anyone is familiar with this.

By far the easiest way to achieve this is to move to RRDTool.  There are
many reporting scripts for RRD-based databases, since this is much more
flexible.  It's also more efficient!

You can switch your existing MRTG over to use RRD without too much trouble.
There is a conversion utility to change .log files to .rrd, and you just
have to add one line to the .cfg files to let MRTG know.  You will also find
a huge performance improvement on data gather.

The downside is that you will need to install a CGI script - such as
routers2, 14all or mrtg-rrd - to display the graphs (which are now created
on demand) but this will give you more flexibility in any case.  Then, there
is a Perl library (and also a PHP library) to access and query the RRD
database from any script you care to write.

Rather than try to parse the old .log files, and have to deal with locking
issues, I'd go this way.

Steve

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://lists.ee.ethz.ch/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://lists.ee.ethz.ch/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the mrtg mailing list