Attached a patch for the rrd-tool LIBDBI integration with the following improvements: