-1

I am trying to use rrdtool to store and graph the number of BGP updates per origin ASN. I am using the python-rrdtool package to create the RRD and populate it with data parsed from a historical CSV file.

The RRD gets created successfully and the updates seem to be stored correctly:

$ 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

When I attempt to generate the graph using the command line tool, the process exits with error code 0. But no graph appears to be generated:

$ 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

I've tried different combinations of command line switches like --imgformat, --height, --width, -t (for title), but nothing seems to work.

(The -s (start time) and -e (end time) switches are in "rrdtool fetch" and "rrdtool graph" to constrain the time period for which I have data.)

I'm running this on Ubuntu 20.04.3, with rrdtool installed from Canonical's 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)

Some answers I've googled indicated that rrdtool might not have all the libraries it needs. I checked that and everything seems to be okay, with one exception.

$ 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

I'm suspecting "linux-vdso.so.1" may be a red herring since I'm able to run rrdtool with no missing-library errors.

What would cause rrdtool graph not to generate any output file?

B Knight
  • 99
  • 1
  • Please trim your code to make it easier to find your problem. Follow these guidelines to create a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). – Community Oct 28 '21 at 10:49

1 Answers1

0

After some readjustment of my search terms, I did find the answer here (thank you thank you jwilson!)

From the rrdtool graph documentation:

You need at least one DEF and one LINE, AREA, GPRINT, PRINT statement to generate anything useful.

The documentation is not clear that, if you do not have a LINE, AREA, GPRINT or PRINT statement, no file gets written and rrdtool exits without doing anything.

B Knight
  • 99
  • 1