[rrd-users] Using SQL backend

Martin Sperl rrdtool at martin.sperl.org
Tue Jan 27 17:03:46 CET 2009


The latest trunk release already includes this patch - did you still 
apply this patch? If so, then you have most likely reverted the patch!

In any case is seems as if libdbi did not get enabled.

Some other diagnostics:
Check if the rrdtool shared library is linked with libdbi - done like 
this (assuming the base directory of the rrdtool snapshot):
ldd ./src/.libs/librrd.so | grep libdbi
and you should get a line like this:
libdbi.so.0 => /usr/lib/libdbi.so.0 (0x00d06000)

If not then the support has not been added.

I also did a quick check with the latest snapshot-tarball and libdbi is 
enabled out of the box for me - see the ps for detailed steps:


p.s: here the steps I have taken to rebuild:
wget http://oss.oetiker.ch/rrdtool/pub/beta/rrdtool-trunk-svn-snap.tar.gz
tar xvzf rrdtool-trunk-svn-snap.tar.gz
cd rrdtool-1.3.99909012700/
export PATH=/opt/rrdtool-dependencies/bin:$PATH # this is only needed 
for my RH4 environment to include all the cairo and pango dependencies...
cd src/
./rrdtool graph - --units=si -l 0 -i -R light --width 600 --height 600 
--full-size-mode \

and the output for the rrdtool command gives me:
ERROR: libdbi: problems connecting to db with connect string (null) - 
error: 1045: Access denied for user 'test'@'localhost' (using password: YES)
expected behaviour, as the credentials are not ok for my local box...

Still need to investigate on the connect string showing as "(null)" in 
the error message...

Note also the use of the DEF is a bit diffent - not "bw" but "avg" 
before the :AVERAGE - see "man rrdgraph_libdbi" for details...

Olivier Doucet wrote:
> Hello everybody !
> I'm trying to use SQL backend for rrdtool graph, as seen here :
> http://lists.ee.ethz.ch/p/rrdtool+libdbi.patch
> I recompiled latest rrdtool (from trunk: RRDtool 1.3.99909012700) with 
> libDBI support, which is confirmed when configure is done :
>            With libDBI: yes
>             Libraries: -lxml2 -lcairo -lcairo -lcairo -lm  -ldbi -ldl 
> -lcairo -lfreetype -lfontconfig -lpng12 -lz -lm -lpixman-1   
> -lglib-2.0   -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 
> -lgmodule-2.0 -lglib-2.0 -lfreetype -lfontconfig -lpng12 -lz -lm 
> -lpixman-1
> Then I tried to do a basic graph with following command line :
> /usr/bin/rrdtool graph - --units=si -l 0 -i -R light --width 600 
> --height 600 --full-size-mode 
> DEF:value="sql//mysql/host='me 
> <>'":bp:AVERAGE 
> LINE1:value#FF0000:value
> But I get error :
> ERROR: opening 'sql//mysql/********: No such file or directory
> (without the ***)
> With a strace :
> [...]
> open("sql//mysql/********", O_RDONLY) = -1 ENOENT (No such file or 
> directory)
> So it seems my syntax is incorrect and is interpreted as a file.
> What is wrong ?
> Thank you
> Olivier
> ------------------------------------------------------------------------
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

More information about the rrd-users mailing list