summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dee6d94)
raw | patch | inline | side by side (parent: dee6d94)
author | Florian Forster <octo@huhu.verplant.org> | |
Thu, 5 Feb 2009 18:15:47 +0000 (19:15 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Thu, 5 Feb 2009 18:15:47 +0000 (19:15 +0100) |
The functionality is now implemented in the more general chain mechanism.
configure.in | patch | blob | history | |
src/Makefile.am | patch | blob | history | |
src/filter_ignore.c | [deleted file] | patch | blob | history |
diff --git a/configure.in b/configure.in
index 83bb03c2af24203ed28557b70e97fce7132da639..c86b71148e27c0844091b4a16f71818129806cde 100644 (file)
--- a/configure.in
+++ b/configure.in
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])
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 222c89bfe431d44218e1b740190e2084f0460f3a..26db76db24cfcb2ad0788679584d5d16b53d207a 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
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
--- 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 <octo at verplant.org>
- **/
-
-#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 : */