X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fmemcachec.c;h=93dbdbc47ad280f6a91b5793747a1397099c3259;hp=451a853852679d44daf2b613bac8914d9ea61e21;hb=633c3966f770e4d46651a2fe219a18d8a9907a9f;hpb=878fc620d483c3802d39f33964188001bdf952ba diff --git a/src/memcachec.c b/src/memcachec.c index 451a8538..93dbdbc4 100644 --- a/src/memcachec.c +++ b/src/memcachec.c @@ -18,7 +18,7 @@ * * Authors: * Doug MacEachern - * Florian octo Forster + * Florian octo Forster **/ #include "collectd.h" @@ -37,6 +37,7 @@ typedef struct web_match_s web_match_t; struct web_match_s /* {{{ */ { char *regex; + char *exclude_regex; int dstype; char *type; char *instance; @@ -220,6 +221,8 @@ static int cmc_config_add_match (web_page_t *page, /* {{{ */ if (strcasecmp ("Regex", child->key) == 0) status = cmc_config_add_string ("Regex", &match->regex, child); + else if (strcasecmp ("ExcludeRegex", child->key) == 0) + status = cmc_config_add_string ("ExcludeRegex", &match->exclude_regex, child); else if (strcasecmp ("DSType", child->key) == 0) status = cmc_config_add_match_dstype (&match->dstype, child); else if (strcasecmp ("Type", child->key) == 0) @@ -262,7 +265,8 @@ static int cmc_config_add_match (web_page_t *page, /* {{{ */ if (status != 0) return (status); - match->match = match_create_simple (match->regex, match->dstype); + match->match = match_create_simple (match->regex, match->exclude_regex, + match->dstype); if (match->match == NULL) { ERROR ("memcachec plugin: tail_match_add_match_simple failed."); @@ -324,7 +328,7 @@ static int cmc_config_add_page (oconfig_item_t *ci) /* {{{ */ if (strcasecmp ("Server", child->key) == 0) status = cmc_config_add_string ("Server", &page->server, child); - if (strcasecmp ("Key", child->key) == 0) + else if (strcasecmp ("Key", child->key) == 0) status = cmc_config_add_string ("Key", &page->key, child); else if (strcasecmp ("Match", child->key) == 0) /* Be liberal with failing matches => don't set `status'. */ @@ -448,7 +452,6 @@ static void cmc_submit (const web_page_t *wp, const web_match_t *wm, /* {{{ */ vl.values = values; vl.values_len = 1; - vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "memcachec", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, wp->instance, sizeof (vl.plugin_instance));