- while (metric_this != NULL){
- metric_next = metric_this->next;
- tcsv_metric_definition_destroy(metric_this);
- metric_this = metric_next;
+ /* Retrieve the data source type from the types db. */
+ ds = plugin_get_ds(md->type);
+ if (ds == NULL)
+ {
+ ERROR ("tail_csv plugin: Failed to look up type \"%s\" for "
+ "metric \"%s\". It may not be defined in the types.db "
+ "file. Please read the types.db(5) manual page for more "
+ "details.",
+ md->type, md->name);
+ continue;
+ }
+ else if (ds->ds_num != 1)
+ {
+ ERROR ("tail_csv plugin: The type \"%s\" has %i data sources. "
+ "Only types with a single data soure are supported.",
+ ds->type, ds->ds_num);
+ continue;
+ }
+
+ md->data_source_type = ds->ds->type;