From 6fe9925aebdc99cee1ae3d00a0a869477400c8e5 Mon Sep 17 00:00:00 2001 From: Pavel Rochnyack Date: Mon, 19 Sep 2016 16:07:53 +0600 Subject: [PATCH] 'curl', 'memcachec', 'tail' and 'tail_csv' plugins: Use 'Plugin' as option name --- src/collectd.conf.pod | 24 ++++++++++++------------ src/curl.c | 2 +- src/memcachec.c | 4 ++-- src/tail.c | 4 ++-- src/tail_csv.c | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index 91ff7416..2f7e1cd5 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -1611,7 +1611,7 @@ finance page and dispatch the value to collectd. - PluginName "quotes" + Plugin "quotes" URL "http://finance.google.com/finance?q=NYSE%3AAMD" User "foo" Password "bar" @@ -1643,9 +1643,9 @@ The following options are valid within B blocks: =over 4 -=item B I +=item B I -Use I as the plugin name when submitting values. +Use I as the plugin name when submitting values. Defaults to 'curl'. =item B I @@ -3542,7 +3542,7 @@ Synopsis of the configuration: Server "localhost" Key "page_key" - PluginName "plugin_name" + Plugin "plugin_name" Regex "(\\d+) bytes sent" DSType CounterAdd @@ -3570,9 +3570,9 @@ B block. When connected to the memcached server, asks for the page I. -=item B I +=item B I -Use I as the plugin name when submitting values. +Use I as the plugin name when submitting values. Defaults to 'memcachec'. =item EBE @@ -7531,7 +7531,7 @@ user using (extended) regular expressions, as described in L. - PluginName "mail" + Plugin "mail" Instance "exim" Interval 60 @@ -7563,12 +7563,12 @@ The config consists of one or more B blocks, each of which configures one logfile to parse. Within each B block, there are one or more B blocks, which configure a regular expression to search for. -The B and B options in the B block may be used to set +The B and B options in the B block may be used to set the plugin name and instance respectively. So in the above example the plugin name C would be used. These options are applied for all B blocks that B it, until the -next B or B option. This way you can extract several plugin +next B or B option. This way you can extract several plugin instances from one logfile, handy when parsing syslog and the like. The B option allows you to define the length of time between reads. If @@ -7750,7 +7750,7 @@ B Index 1 - PluginName "snortstats" + Plugin "snortstats" Instance "eth0" Interval 600 Collect "snort-dropped" @@ -7803,9 +7803,9 @@ I block but there can be multiple if you have multiple CSV files. =over 4 -=item B I +=item B I -Use I as the plugin name when submitting values. +Use I as the plugin name when submitting values. Defaults to 'tail_csv'. =item B I diff --git a/src/curl.c b/src/curl.c index d1957d2d..02761d26 100644 --- a/src/curl.c +++ b/src/curl.c @@ -438,7 +438,7 @@ static int cc_config_add_page(oconfig_item_t *ci) /* {{{ */ for (int i = 0; i < ci->children_num; i++) { oconfig_item_t *child = ci->children + i; - if (strcasecmp("PluginName", child->key) == 0) + if (strcasecmp("Plugin", child->key) == 0) status = cf_util_get_string(child, &page->plugin_name); else if (strcasecmp("URL", child->key) == 0) status = cf_util_get_string(child, &page->url); diff --git a/src/memcachec.c b/src/memcachec.c index 965aa653..bd088ecd 100644 --- a/src/memcachec.c +++ b/src/memcachec.c @@ -304,8 +304,8 @@ static int cmc_config_add_page(oconfig_item_t *ci) /* {{{ */ status = cmc_config_add_string("Server", &page->server, child); else if (strcasecmp("Key", child->key) == 0) status = cmc_config_add_string("Key", &page->key, child); - else if (strcasecmp("PluginName", child->key) == 0) - status = cmc_config_add_string("PluginName", &page->plugin_name, child); + else if (strcasecmp("Plugin", child->key) == 0) + status = cmc_config_add_string("Plugin", &page->plugin_name, child); else if (strcasecmp("Match", child->key) == 0) /* Be liberal with failing matches => don't set `status'. */ cmc_config_add_match(page, child); diff --git a/src/tail.c b/src/tail.c index f7f061a9..a135d79c 100644 --- a/src/tail.c +++ b/src/tail.c @@ -34,7 +34,7 @@ /* * * - * PluginName "mail" + * Plugin "mail" * Instance "exim" * Interval 60 * @@ -233,7 +233,7 @@ static int ctail_config_add_file(oconfig_item_t *ci) { oconfig_item_t *option = ci->children + i; int status = 0; - if (strcasecmp("PluginName", option->key) == 0) + if (strcasecmp("Plugin", option->key) == 0) status = cf_util_get_string (option, &plugin_name); else if (strcasecmp("Instance", option->key) == 0) status = cf_util_get_string(option, &plugin_instance); diff --git a/src/tail_csv.c b/src/tail_csv.c index 498b4c11..f3039885 100644 --- a/src/tail_csv.c +++ b/src/tail_csv.c @@ -451,7 +451,7 @@ static int tcsv_config_add_file(oconfig_item_t *ci) { cf_util_get_cdtime(option, &id->interval); else if (strcasecmp("TimeFrom", option->key) == 0) status = tcsv_config_get_index(option, &id->time_from); - else if (strcasecmp("PluginName", option->key) == 0) + else if (strcasecmp("Plugin", option->key) == 0) status = cf_util_get_string(option, &id->plugin_name); else { WARNING("tail_csv plugin: Option `%s' not allowed here.", option->key); -- 2.11.0