"rrdtool graph"命令执行时没有错误,但不会创建任何文件



我正在尝试使用rrdtool来存储和绘制每个源ASN的BGP更新数量。我使用python-rrdtool包来创建RRD,并用从历史CSV文件解析的数据填充它。

RRD被成功创建,更新似乎被正确存储:

$ rrdtool fetch -e 1635077700 -s 1635074400 updates-2021-10-25-originas.rrd AVERAGE
45609                9829                4758               24560              134371               45769               45528              134033              134674               17439
1635074700: -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan
1635075000: 5.3247000000e+04 4.7140000000e+03 2.8530000000e+03 1.5900000000e+03 1.8880000000e+03 1.1760000000e+03 9.7800000000e+02 4.8300000000e+02 2.3500000000e+02 5.7900000000e+02
1635075300: 9.0302000000e+04 5.1010000000e+03 2.9060000000e+03 2.6160000000e+03 2.0000000000e+03 1.5190000000e+03 1.3270000000e+03 1.2370000000e+03 1.1120000000e+03 7.8500000000e+02
1635075600: 1.0403100000e+05 5.2270000000e+03 3.0260000000e+03 2.8990000000e+03 2.1260000000e+03 1.5740000000e+03 1.4100000000e+03 1.6890000000e+03 1.7640000000e+03 9.2000000000e+02
1635075900: 9.7802000000e+04 5.2220000000e+03 2.8260000000e+03 2.6140000000e+03 2.0850000000e+03 1.5500000000e+03 1.3400000000e+03 1.8530000000e+03 1.4570000000e+03 9.4600000000e+02
1635076200: 9.1486000000e+04 5.7090000000e+03 3.5840000000e+03 2.8870000000e+03 2.0980000000e+03 1.7810000000e+03 1.2890000000e+03 3.2900000000e+02 3.2900000000e+02 8.6100000000e+02
1635076500: 1.0457200000e+05 6.6210000000e+03 3.6170000000e+03 3.2040000000e+03 2.2840000000e+03 1.8300000000e+03 1.5070000000e+03 1.2450000000e+03 8.1600000000e+02 9.0700000000e+02
1635076800: 6.8104000000e+04 3.2830000000e+03 1.9570000000e+03 1.8700000000e+03 1.7000000000e+03 1.0960000000e+03 9.3700000000e+02 9.1100000000e+02 6.6900000000e+02 6.5600000000e+02
1635077100: 2.5433000000e+04 1.0370000000e+03 7.2600000000e+02 7.4800000000e+02 4.8600000000e+02 3.6000000000e+02 3.8400000000e+02 2.4200000000e+02 1.6900000000e+02 1.8300000000e+02
1635077400: -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan
1635077700: -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan
1635078000: -nan -nan -nan -nan -nan -nan -nan -nan -nan -nan

当我尝试使用命令行工具生成图形时,进程退出,错误代码为0。但是没有生成任何图形:

$ ls -l
total 260469
-rwxrwxrwx 1 root root    385626 Oct 26 20:41 updates-2021-10-25-head100k.txt.bz2
-rwxrwxrwx 1 root root      7232 Oct 26 11:15 updates-2021-10-25-head1k.txt.bz2
-rwxrwxrwx 1 root root   3653614 Oct 26 23:19 updates-2021-10-25-head1m.txt.bz2
-rwxrwxrwx 1 root root    613376 Oct 27 10:14 updates-2021-10-25-originas.rrd
-rwxrwxrwx 1 root root    613376 Oct 27 10:14 updates-2021-10-25-prefix.rrd
-rwxrwxrwx 1 root root  53683974 Oct 26 18:00 updates-2021-10-25-report.txt
-rwxrwxrwx 1 root root 207761131 Oct 25 13:51 updates-2021-10-25.txt.bz2
$ rrdtool graph -e 1635077700 -s 1635074400 -a PNG updates-2021-10-25-originas.png  DEF:45609=updates-2021-10-25-originas.rrd:45609:AVERAGE
$ echo $?
0
$ ls -l
total 260469
-rwxrwxrwx 1 root root    385626 Oct 26 20:41 updates-2021-10-25-head100k.txt.bz2
-rwxrwxrwx 1 root root      7232 Oct 26 11:15 updates-2021-10-25-head1k.txt.bz2
-rwxrwxrwx 1 root root   3653614 Oct 26 23:19 updates-2021-10-25-head1m.txt.bz2
-rwxrwxrwx 1 root root    613376 Oct 27 10:14 updates-2021-10-25-originas.rrd
-rwxrwxrwx 1 root root    613376 Oct 27 10:14 updates-2021-10-25-prefix.rrd
-rwxrwxrwx 1 root root  53683974 Oct 26 18:00 updates-2021-10-25-report.txt
-rwxrwxrwx 1 root root 207761131 Oct 25 13:51 updates-2021-10-25.txt.bz2

我尝试了不同的命令行开关组合,如——imgformat,——height,——width, -t(用于标题),但似乎都不起作用。

(-s(开始时间)和-e(结束时间)开关在"rrdtool fetch";rrdtool图形"来约束我拥有数据的时间段。

我在Ubuntu 20.04.3上运行这个程序,rrdtool是从Canonical的repo安装的。

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:    20.04
Codename:   focal
$ which rrdtool
/usr/bin/rrdtool
$ dpkg -S /usr/bin/rrdtool
rrdtool: /usr/bin/rrdtool
$ dpkg -l | grep rrdtool
ii  python3-rrdtool:amd64                      1.7.2-3build2                         amd64        time-series data storage and display system (Python3 interface)
ii  python3-rrdtool-dbg:amd64                  1.7.2-3build2                         amd64        time-series data storage and display system (Python3 debug interface)
ii  rrdtool                                    1.7.2-3build2                         amd64        time-series data storage and display system (programs)

我搜索的一些答案表明rrdtool可能没有它需要的所有库。我检查了一下,一切似乎都没问题,只有一个例外。

$ ldd /usr/bin/rrdtool
linux-vdso.so.1 (0x00007ffd299c6000)
librrd.so.8 => /lib/x86_64-linux-gnu/librrd.so.8 (0x00007f2dde736000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2dde713000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2dde521000)
libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f2dde4e9000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2dde39a000)
libdbi.so.1 => /lib/x86_64-linux-gnu/libdbi.so.1 (0x00007f2dde18a000)
libpangocairo-1.0.so.0 => /lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f2dde176000)
libpango-1.0.so.0 => /lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f2dde127000)
libgobject-2.0.so.0 => /lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f2dde0c7000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f2dddf9e000)
libcairo.so.2 => /lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f2ddde7b000)
libxml2.so.2 => /lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f2dddcc1000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2dde7b2000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f2dddca3000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2dddc9d000)
libpangoft2-1.0.so.0 => /lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f2dddc84000)
libfontconfig.so.1 => /lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f2dddc3d000)
libfribidi.so.0 => /lib/x86_64-linux-gnu/libfribidi.so.0 (0x00007f2dddc20000)
libthai.so.0 => /lib/x86_64-linux-gnu/libthai.so.0 (0x00007f2dddc15000)
libharfbuzz.so.0 => /lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f2dddb0e000)
libffi.so.7 => /lib/x86_64-linux-gnu/libffi.so.7 (0x00007f2dddb02000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f2ddda8f000)
libpixman-1.so.0 => /lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f2ddd9e8000)
libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f2ddd929000)
libxcb-shm.so.0 => /lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f2ddd924000)
libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f2ddd8f8000)
libxcb-render.so.0 => /lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f2ddd8e9000)
libXrender.so.1 => /lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f2ddd6df000)
libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007f2ddd5a2000)
libXext.so.6 => /lib/x86_64-linux-gnu/libXext.so.6 (0x00007f2ddd58d000)
libicuuc.so.66 => /lib/x86_64-linux-gnu/libicuuc.so.66 (0x00007f2ddd3a7000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f2ddd37c000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f2ddd34e000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f2ddd345000)
libdatrie.so.1 => /lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007f2ddd33b000)
libgraphite2.so.3 => /lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f2ddd30e000)
libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007f2ddd306000)
libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f2ddd2fe000)
libicudata.so.66 => /lib/x86_64-linux-gnu/libicudata.so.66 (0x00007f2ddb83d000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2ddb65b000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2ddb640000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f2ddb624000)
$ ls `ldd /usr/bin/rrdtool | sed -e 's/.*=>[ t]*//' | sed -e 's/ (0x.*//'`
ls: cannot access 'linux-vdso.so.1': No such file or directory
/lib64/ld-linux-x86-64.so.2               /lib/x86_64-linux-gnu/libfribidi.so.0      /lib/x86_64-linux-gnu/libpangocairo-1.0.so.0  /lib/x86_64-linux-gnu/libXau.so.6
/lib/x86_64-linux-gnu/libbsd.so.0         /lib/x86_64-linux-gnu/libgcc_s.so.1        /lib/x86_64-linux-gnu/libpangoft2-1.0.so.0    /lib/x86_64-linux-gnu/libxcb-render.so.0
/lib/x86_64-linux-gnu/libcairo.so.2       /lib/x86_64-linux-gnu/libglib-2.0.so.0     /lib/x86_64-linux-gnu/libpcre.so.3            /lib/x86_64-linux-gnu/libxcb-shm.so.0
/lib/x86_64-linux-gnu/libc.so.6           /lib/x86_64-linux-gnu/libgobject-2.0.so.0  /lib/x86_64-linux-gnu/libpixman-1.so.0        /lib/x86_64-linux-gnu/libxcb.so.1
/lib/x86_64-linux-gnu/libdatrie.so.1      /lib/x86_64-linux-gnu/libgraphite2.so.3    /lib/x86_64-linux-gnu/libpng16.so.16          /lib/x86_64-linux-gnu/libXdmcp.so.6
/lib/x86_64-linux-gnu/libdbi.so.1         /lib/x86_64-linux-gnu/libharfbuzz.so.0     /lib/x86_64-linux-gnu/libpthread.so.0         /lib/x86_64-linux-gnu/libXext.so.6
/lib/x86_64-linux-gnu/libdl.so.2          /lib/x86_64-linux-gnu/libicudata.so.66     /lib/x86_64-linux-gnu/librrd.so.8             /lib/x86_64-linux-gnu/libxml2.so.2
/lib/x86_64-linux-gnu/libexpat.so.1       /lib/x86_64-linux-gnu/libicuuc.so.66       /lib/x86_64-linux-gnu/libstdc++.so.6          /lib/x86_64-linux-gnu/libXrender.so.1
/lib/x86_64-linux-gnu/libffi.so.7         /lib/x86_64-linux-gnu/liblzma.so.5         /lib/x86_64-linux-gnu/libthai.so.0            /lib/x86_64-linux-gnu/libz.so.1
/lib/x86_64-linux-gnu/libfontconfig.so.1  /lib/x86_64-linux-gnu/libm.so.6            /lib/x86_64-linux-gnu/libuuid.so.1
/lib/x86_64-linux-gnu/libfreetype.so.6    /lib/x86_64-linux-gnu/libpango-1.0.so.0    /lib/x86_64-linux-gnu/libX11.so.6

我怀疑"linux-vdso.so.1"可能是一个转移注意力的问题,因为我能够运行rrdtool而没有丢失库错误。

什么会导致rrdtool图形不生成任何输出文件?

在调整了我的搜索条件后,我确实在这里找到了答案(谢谢你,谢谢你jwilson!)

rrdtool图形文档:

您至少需要一个DEF和一个LINE, AREA, GPRINT, PRINT语句来生成任何有用的内容

文档没有明确说明,如果没有LINE, AREA, GPRINT或PRINT语句,则没有文件写入,rrdtool不做任何事情就退出。

相关内容

  • 没有找到相关文章

最新更新