下载 http://download.heanny.cn/download/rrd_fetch.tar.gz
https://dl.cactifans.com/tools/rrd_fetch.tar.gz
cd /usr/local/rrd_expor
解压
wget https://dl.cactifans.com/tools/rrd_fetch.tar.gz
tar
zxvf rrd_fetch.tar.gz
mv
rrd_fetch/fetch_x64
.
chmod
+x fetch_x64
########帮助信息
[root@heannyrra]# ./fetch_x64 --help
Usage of ./fetch_x64:
-list="list.csv": the list files of rrd files
-log="/var/log/fetchinfo.log": Log file
name
-outdir="/opt/": the export
files
-list为要导入rrd文件的列表文件,默认为程序目录下的list.csv文件 -log 为导出工具的日志文件,默认为/var/log/fetchinfo.log -outdir为导出的csv文件目录,默认为/opt/ -step=为rrd文件的步进,默认为300
编写list.cvs文件
(, )file (, )
rangeNum () () i (rangeNum)num i line (num,num)
file.(line)
file.()
上传到服务器
执行导出
?
1 | ./fetch_x64 |
---|
执行后,可查看日志文件判断是否导出成功
?
1 | cat /var/log/fetchinfo.log |
---|
获取每个端口最高峰
()i (, )name i
file (name)
(i, file.()[].(, ))
file.()
将没用的删除
数据处理
()liuliangData, timeData [], {} files (.())
line files.()lineData line.(, )
liuliang lineData[].(, ).()
liuliangData.(liuliang)
ll liuliangData[]time ll[][]
inData (ll[].(, ).(, ))
outData (ll[].(, ).(, ))
(time, inData, outData)
timeData[time] [inData, outData]
timeData