summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0fa02df)
raw | patch | inline | side by side (parent: 0fa02df)
author | Pavel Rochnyack <pavel2000@ngs.ru> | |
Thu, 25 Feb 2016 14:31:46 +0000 (21:31 +0700) | ||
committer | Florian Forster <octo@collectd.org> | |
Thu, 28 Sep 2017 14:42:38 +0000 (16:42 +0200) |
src/collectd.conf.pod | patch | blob | history | |
src/curl_json.c | patch | blob | history |
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index fdbe1956fdae87689625dc67b8c32abd29e11ee5..b497e1d42104d104a06ad206c90d6c7c7f59cbee 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
Use I<Name> as the host name when submitting values. Defaults to the global
host name setting.
+=item B<Plugin> I<Plugin>
+
+Use I<Plugin> as the plugin name when submitting values.
+Defaults to 'curl_json'.
+
=item B<Instance> I<Instance>
Sets the plugin instance to I<Instance>.
diff --git a/src/curl_json.c b/src/curl_json.c
index 35b11c02d9f08c0e61859ff9a93bafdfcd03274a..756f24f3557dc4dbd2e22c730289fca2f44dff04 100644 (file)
--- a/src/curl_json.c
+++ b/src/curl_json.c
struct cj_s /* {{{ */
{
char *instance;
+ char *plugin_name;
char *host;
char *sock;
db->tree = NULL;
sfree(db->instance);
+ sfree(db->plugin_name);
sfree(db->host);
sfree(db->sock);
if (strcasecmp("Instance", child->key) == 0)
status = cf_util_get_string(child, &db->instance);
+ else if (strcasecmp("Plugin", child->key) == 0)
+ status = cf_util_get_string(child, &db->plugin_name);
else if (strcasecmp("Host", child->key) == 0)
status = cf_util_get_string(child, &db->host);
else if (db->url && strcasecmp("User", child->key) == 0)
sstrncpy(vl.type_instance, key->instance, sizeof(vl.type_instance));
sstrncpy(vl.host, cj_host(db), sizeof(vl.host));
- sstrncpy(vl.plugin, "curl_json", sizeof(vl.plugin));
+ sstrncpy(vl.plugin, (db->plugin_name != NULL) ? db->plugin_name : "curl_json",
+ sizeof(vl.plugin));
sstrncpy(vl.plugin_instance, db->instance, sizeof(vl.plugin_instance));
sstrncpy(vl.type, key->type, sizeof(vl.type));