readme
来自「监控软件rrdtools」· 代码 · 共 63 行
TXT
63 行
log2rrdUsage:log2rrd.pl {mrtg logfile} {destination directory}Log2rrd is a simple tool for converting MRTG logfiles into round robindatabase (RRD) files. The original version was written last year byWrolf Courtney <wrolf@concentric.net> and Russ Wright <wright@LBL.Gov>with an early test version of RRDTOOL (mrtg-19980526.08). Thisversion has been modified to work with the current shared-perl releaseof RRD (RRDs).This script only moves the input/output data averages and does notmake any effort to retain the maximum data rate info that is presentin the mrtg logfiles. This means that when you request maximum valuesfor a given time range from your new rrd archive, it will only showyou the averaged max values and not the original data peaks thatoccured in the averaged time period. This may or may not be a problemat your site.The conversion script expects 2 arguments - the mrtg logfile to readand the path for the resulting rrd file. The script will attempt toisolate the filename from any path specified for the mrtg inputlogfile to create the rrd output file name with the specifieddestination directory. If no destination directory name is included,the rrd file will be written in the connected directory. Note that the resulting rrd DS type is GAUGE. With a DS type ofcounter, rrdupdate will attempt to interpret input data as a countervalue and make a new data average for the specified time interval.In this case, we need to trick rrdcreate/rrdupdate into letting usinput the data values directly because mrtg had already consolidatedthe counter data. The script contains lines of code that can beuncommented to allow log2rrd to automatically call rrdtune to changethe resulting file to use the COUNTER data type after the mrtglogfiles have been read in. Since not all mrtg data files are counterdata, I leave this option up to the user as to whether to convertlater by hand with rrdtune or let log2rrd perform the task.Considerations for filenames and converting large numbers of files:At my own site, I have over 40 Cisco 75xx routers with lots ofinterfaces being monitored per router plus about 60 Cisco 5300terminal servers. Running log2rrd for each interface individuallywould be a very painful process. Since I am in the process of movingall of my mrtg datasets over to Cricket, I hacked a separate versionof log2rrd that had more specific file name conversion code to matchmy Cricket target names. This version of log2rrd was called up byanother script that looped through an entire mrtg workdir andconverted all logfiles present in that directory. This code was fartoo specific to my site's version of mrtg logfile names and desiredCricket target info to be included here. It would not be a difficulttask to wrap this log2rrd script in a similar fashion tailored to yourown needs. If you have 100's or 1000's of logfiles to move, theeffort is well worthwhile.Alan LichtyInternetworking PlannerElectric Lightwave, Inc.(360)816-4167
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?