From: Florian Forster Date: Thu, 5 Feb 2009 18:15:47 +0000 (+0100) Subject: filter_ignore: Remove this plugin. X-Git-Tag: collectd-4.6.0~65 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=8490780130e2b31287d6731c187ba0ae3b645368;p=collectd.git filter_ignore: Remove this plugin. The functionality is now implemented in the more general chain mechanism. --- diff --git a/configure.in b/configure.in index 83bb03c2..c86b7114 100644 --- a/configure.in +++ b/configure.in @@ -2990,7 +2990,6 @@ AC_PLUGIN([email], [yes], [EMail statistics]) AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics]) AC_PLUGIN([exec], [yes], [Execution of external programs]) AC_PLUGIN([filecount], [yes], [Count files in directories]) -AC_PLUGIN([filter_ignore], [yes], [Ignore specific values]) AC_PLUGIN([hddtemp], [yes], [Query hddtempd]) AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics]) AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters]) @@ -3188,7 +3187,6 @@ Configuration: entropy . . . . . . . $enable_entropy exec . . . . . . . . $enable_exec filecount . . . . . . $enable_filecount - filter_ignore . . . . $enable_filter_ignore hddtemp . . . . . . . $enable_hddtemp interface . . . . . . $enable_interface iptables . . . . . . $enable_iptables diff --git a/src/Makefile.am b/src/Makefile.am index 222c89bf..26db76db 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -291,14 +291,6 @@ collectd_LDADD += "-dlopen" filecount.la collectd_DEPENDENCIES += filecount.la endif -if BUILD_PLUGIN_FILTER_IGNORE -pkglib_LTLIBRARIES += filter_ignore.la -filter_ignore_la_SOURCES = filter_ignore.c -filter_ignore_la_LDFLAGS = -module -avoid-version -collectd_LDADD += "-dlopen" filter_ignore.la -collectd_DEPENDENCIES += filter_ignore.la -endif - if BUILD_PLUGIN_HDDTEMP pkglib_LTLIBRARIES += hddtemp.la hddtemp_la_SOURCES = hddtemp.c diff --git a/src/filter_ignore.c b/src/filter_ignore.c deleted file mode 100644 index 19588842..00000000 --- a/src/filter_ignore.c +++ /dev/null @@ -1,147 +0,0 @@ -/** - * collectd - src/entropy.c - * Copyright (C) 2008 Florian octo Forster - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; only version 2 of the License is applicable. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Authors: - * Florian octo Forster - **/ - -#include "collectd.h" -#include "common.h" -#include "plugin.h" -#include "configfile.h" -#include "utils_ignorelist.h" - -/* - * Variables - */ -static ignorelist_t *il_host = NULL; -static ignorelist_t *il_plugin = NULL; -static ignorelist_t *il_type = NULL; - -static const char *config_keys[] = -{ - "IgnoreHost", - "IgnorePlugin", - "IgnoreType" -}; -static int config_keys_num = STATIC_ARRAY_SIZE (config_keys); - -/* - * Functions - */ -static int ignorelist_add_create (ignorelist_t **il_ptr, const char *entry) -{ - ignorelist_t *il; - int status; - - il = *il_ptr; - - if (il == NULL) - { - il = ignorelist_create (/* ignore = */ 0); - if (il == NULL) - { - ERROR ("filter_ignore plugin: ignorelist_create failed."); - return (-1); - } - *il_ptr = il; - } - - status = ignorelist_add (il, entry); - if (status != 0) - { - ERROR ("filter_ignore plugin: ignorelist_add failed with error %i.", - status); - return (status); - } - - return (0); -} /* int ignorelist_add_create */ - -static int fi_config (const char *key, const char *value) -{ - int status; - - status = 0; - - if (strcasecmp ("IgnoreHost", key) == 0) - status = ignorelist_add_create (&il_host, value); - else if (strcasecmp ("IgnorePlugin", key) == 0) - status = ignorelist_add_create (&il_plugin, value); - else if (strcasecmp ("IgnoreType", key) == 0) - status = ignorelist_add_create (&il_type, value); - else - return (-1); - - if (status < 0) - status = status * (-1); - - return (status); -} /* int fi_config */ - -static int fi_filter (const data_set_t *ds, value_list_t *vl) -{ - int status; - - if (il_host != NULL) - { - status = ignorelist_match (il_host, vl->host); - if (status != 0) - return (FILTER_IGNORE); - } - - if (il_plugin != NULL) - { - char buffer[2 * DATA_MAX_NAME_LEN]; - - if (vl->plugin_instance[0] == 0) - sstrncpy (buffer, vl->plugin, sizeof (buffer)); - else - ssnprintf (buffer, sizeof (buffer), "%s-%s", - vl->plugin, vl->plugin_instance); - - status = ignorelist_match (il_plugin, buffer); - if (status != 0) - return (FILTER_IGNORE); - } - - if (il_type != NULL) - { - char buffer[2 * DATA_MAX_NAME_LEN]; - - if (vl->type_instance[0] == 0) - sstrncpy (buffer, vl->type, sizeof (buffer)); - else - ssnprintf (buffer, sizeof (buffer), "%s-%s", - vl->type, vl->type_instance); - - status = ignorelist_match (il_type, buffer); - if (status != 0) - return (FILTER_IGNORE); - } - - return (0); -} /* int fi_filter */ - -void module_register (void) -{ - plugin_register_config ("filter_ignore", fi_config, - config_keys, config_keys_num); - plugin_register_filter ("filter_ignore", fi_filter); -} /* void module_register */ - -/* vim: set sw=2 sts=2 et fdm=marker : */