- status = ds_list_from_rrd_file (file, &dses_num, &dses);
- if (status != 0)
- {
- free (file);
- return (status);
- }
-
- for (i = 0; i < dses_num; i++)
- {
- int index;
-
- DEBUG ("gl_ident_get_rrdargs: ds[%lu] = %s;\n", (unsigned long) i, dses[i]);
-
- index = array_argc (args);
-
- /* CDEFs */
- array_append_format (args, "DEF:def_%04i_min=%s:%s:MIN",
- index, file, dses[i]);
- array_append_format (args, "DEF:def_%04i_avg=%s:%s:AVERAGE",
- index, file, dses[i]);
- array_append_format (args, "DEF:def_%04i_max=%s:%s:MAX",
- index, file, dses[i]);
- /* VDEFs */
- array_append_format (args, "VDEF:vdef_%04i_min=def_%04i_min,MINIMUM",
- index, index);
- array_append_format (args, "VDEF:vdef_%04i_avg=def_%04i_avg,AVERAGE",
- index, index);
- array_append_format (args, "VDEF:vdef_%04i_max=def_%04i_max,MAXIMUM",
- index, index);
- array_append_format (args, "VDEF:vdef_%04i_lst=def_%04i_avg,LAST",
- index, index);
-
- /* Graph part */
- array_append_format (args, "LINE1:def_%04i_avg#%06"PRIx32":%s",
- index, def->color, dses[i]);
- array_append_format (args, "GPRINT:vdef_%04i_min:%%lg min,", index);
- array_append_format (args, "GPRINT:vdef_%04i_avg:%%lg avg,", index);
- array_append_format (args, "GPRINT:vdef_%04i_max:%%lg max,", index);
- array_append_format (args, "GPRINT:vdef_%04i_lst:%%lg last\\l", index);
-
- free (dses[i]);
- }
+ index = array_argc (args);
+
+ /* CDEFs */
+ array_append_format (args, "DEF:def_%04i_min=%s:%s:MIN",
+ index, file, def->ds_name);
+ array_append_format (args, "DEF:def_%04i_avg=%s:%s:AVERAGE",
+ index, file, def->ds_name);
+ array_append_format (args, "DEF:def_%04i_max=%s:%s:MAX",
+ index, file, def->ds_name);
+ /* VDEFs */
+ array_append_format (args, "VDEF:vdef_%04i_min=def_%04i_min,MINIMUM",
+ index, index);
+ array_append_format (args, "VDEF:vdef_%04i_avg=def_%04i_avg,AVERAGE",
+ index, index);
+ array_append_format (args, "VDEF:vdef_%04i_max=def_%04i_max,MAXIMUM",
+ index, index);
+ array_append_format (args, "VDEF:vdef_%04i_lst=def_%04i_avg,LAST",
+ index, index);
+
+ /* Graph part */
+ array_append_format (args, "LINE1:def_%04i_avg#%06"PRIx32":%s",
+ index, def->color, def->ds_name);
+ array_append_format (args, "GPRINT:vdef_%04i_min:%%lg min,", index);
+ array_append_format (args, "GPRINT:vdef_%04i_avg:%%lg avg,", index);
+ array_append_format (args, "GPRINT:vdef_%04i_max:%%lg max,", index);
+ array_append_format (args, "GPRINT:vdef_%04i_lst:%%lg last\\l", index);