Code

make sure compensation averages are inside the min and max values observed in the...
[rrdtool-all.git] / contrib / log2rrd / README
1                                log2rrd
3 Usage:
5 log2rrd.pl {mrtg logfile} {destination directory}
7 Log2rrd is a simple tool for converting MRTG logfiles into round robin
8 database (RRD) files.  The original version was written last year by
9 Wrolf Courtney <wrolf@concentric.net> and Russ Wright <wright@LBL.Gov>
10 with an early test version of RRDTOOL (mrtg-19980526.08).  This
11 version has been modified to work with the current shared-perl release
12 of RRD (RRDs).
14 This script only moves the input/output data averages and does not
15 make any effort to retain the maximum data rate info that is present
16 in the mrtg logfiles.  This means that when you request maximum values
17 for a given time range from your new rrd archive, it will only show
18 you the averaged max values and not the original data peaks that
19 occured in the averaged time period.  This may or may not be a problem
20 at your site.
22 The conversion script expects 2 arguments - the mrtg logfile to read
23 and the path for the resulting rrd file.  The script will attempt to
24 isolate the filename from any path specified for the mrtg input
25 logfile to create the rrd output file name with the specified
26 destination directory.  If no destination directory name is included,
27 the rrd file will be written in the connected directory. 
29 Note that the resulting rrd DS type is GAUGE.  With a DS type of
30 counter, rrdupdate will attempt to interpret input data as a counter
31 value and make a new data average for the specified time interval.
32 In this case, we need to trick rrdcreate/rrdupdate into letting us
33 input the data values directly because mrtg had already consolidated
34 the counter data.  The script contains lines of code that can be
35 uncommented to allow log2rrd to automatically call rrdtune to change
36 the resulting file to use the COUNTER data type after the mrtg
37 logfiles have been read in.  Since not all mrtg data files are counter
38 data, I leave this option up to the user as to whether to convert
39 later by hand with rrdtune or let log2rrd perform the task.
41 Considerations for filenames and converting large numbers of files:
43 At my own site, I have over 40 Cisco 75xx routers with lots of
44 interfaces being monitored per router plus about 60 Cisco 5300
45 terminal servers.  Running log2rrd for each interface individually
46 would be a very painful process.  Since I am in the process of moving
47 all of my mrtg datasets over to Cricket, I hacked a separate version
48 of log2rrd that had more specific file name conversion code to match
49 my Cricket target names.  This version of log2rrd was called up by
50 another script that looped through an entire mrtg workdir and
51 converted all logfiles present in that directory.  This code was far
52 too specific to my site's version of mrtg logfile names and desired
53 Cricket target info to be included here.  It would not be a difficult
54 task to wrap this log2rrd script in a similar fashion tailored to your
55 own needs.  If you have 100's or 1000's of logfiles to move, the
56 effort is well worthwhile.
58 Alan Lichty
59 Internetworking Planner
60 Electric Lightwave, Inc.
61 (360)816-4167