[rrd-users] RRD File Not Being Created (linux, RRDTool 1-1.3.1, rrdlib, c++)

Mark Easton mark63 at azurebell.co.nz
Wed Jul 30 01:41:57 CEST 2008


When I call rrd_create in my program it returns 0 and there is no error set
(rrd_get_error()). Yet the rrd files are not created. I have checked folder
permissions and they are fine. I have run the "rrdtool create" command from
command line, using the same parameters and that works fine. 

Also, I had to move the DS parameter to the last position in the array. When
I had it before the RRA parameters rrd_get_error() returned that there was
not a data source declared. That is strange also.

So, why is my c++ app not creating any files and why did I have to move the
DS to the last array position? This code snippet shows what I am doing:

	char start_time_s[50];
    	long start_time;
	int ret;

	start_time = (long)time (NULL);
	sprintf (start_time_s, "%ld", start_time);

	char *opts[] = { _rrd_file_path, "--start", start_time_s, "--step",
			"RRA:AVERAGE:0.5:1:10080", "RRA:MIN:0.5:1:10080", 
			"RRA:MAX:0.5:1:10080", "RRA:LAST:0.5:1:10800",
			"RRA:AVERAGE:0.5:60:4464", "RRA:MIN:0.5:60:4464",
			"RRA:MAX:0.5:60:4464", "RRA:LAST:0.5:60:4464", 
			"RRA:AVERAGE:0.5:1440:365", "RRA:MIN:0.5:1440:365", 
			"RRA:MAX:0.5:1440:365", "RRA:LAST:0.5:1440:365",
			"DS:sensor:GAUGE:120:U:U" };
	ret = rrd_create( 18, opts);
	if (ret == -1)
		stdout << rrd_get_error();


Mark Easton (BSc)
Mobile/Embedded Linux Developer

Email: mark63 at azurebell.co.nz
Phone: +64 7 578 7895
Mobile: +64 27 5757 409

More information about the rrd-users mailing list