Code

collectd::unixsock: Report an error if TimeseriesBackend != rrdtool.
authorSebastian Harl <sh@tokkee.org>
Thu, 21 Aug 2014 05:10:05 +0000 (22:10 -0700)
committerSebastian Harl <sh@tokkee.org>
Thu, 21 Aug 2014 05:10:05 +0000 (22:10 -0700)
No other backends are supported yet by the plugin. Support for other types
will require different metric store ID generation.

src/plugins/backend/collectd/unixsock.c

index b1db539b84738a571a8b456b45658c6a6099593f..e7b6416999065d49f12f17748250e5c5dfb00780 100644 (file)
@@ -405,6 +405,17 @@ sdb_collectd_config_instance(oconfig_item_t *ci)
        }
 
        if (ud->ts_type) {
+               /* TODO: add support for other backend types
+                * -> will require different ID generation */
+               if (strcasecmp(ud->ts_type, "rrdtool")) {
+                       sdb_log(SDB_LOG_ERR, "collectd::unixsock backend: "
+                                       "TimeseriesBackend '%s' is not supported - "
+                                       "use 'rrdtool' instead.", ud->ts_type);
+                       ud->ts_type = ud->ts_base = NULL;
+                       user_data_destroy(ud);
+                       return -1;
+               }
+
                ud->ts_type = strdup(ud->ts_type);
                ud->ts_base = strdup(ud->ts_base);
                if ((! ud->ts_type) || (! ud->ts_base)) {