+<DataProvider "rrdtool">
+ DataDir "/var/lib/collectd/rrd"
+</DataProvider>
+
<Graph>
Host "/any/"
Plugin "cpu"
action_show_graph_json.c action_show_graph_json.h \
action_show_instance.c action_show_instance.h \
common.c common.h \
- dp_rrdtool.c \
+ data_provider.c data_provider.h \
+ dp_rrdtool.c dp_rrdtool.h \
filesystem.c filesystem.h \
graph_types.h \
graph.c graph.h \
--- /dev/null
+/**
+ * collection4 - data_provider.c
+ * Copyright (C) 2010 Florian octo Forster
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ * Authors:
+ * Florian octo Forster <ff at octo.it>
+ **/
+
+#include "data_provider.h"
+#include "dp_rrdtool.h"
+
+int data_provider_config (const oconfig_item_t *ci) /* {{{ */
+{
+ /* FIXME: Actually determine which data provider to call. */
+ return (dp_rrdtool_config (ci));
+} /* }}} int data_provider_config */
+
+/* vim: set sw=2 sts=2 et fdm=marker : */
#define DATA_PROVIDER_H 1
#include "graph_types.h"
+#include "oconfig.h"
#include <time.h>
};
typedef struct data_provider_s data_provider_t;
+int data_provider_config (const oconfig_item_t *ci);
+
#endif /* DATA_PROVIDER_H */
/* vim: set sw=2 sts=2 et fdm=marker : */
return (-1);
} /* }}} int print_graph */
-int dp_rrdtool_config (oconfig_item_t *ci)
+int dp_rrdtool_config (const oconfig_item_t *ci)
{ /* {{{ */
dp_rrdtool_t *conf;
--- /dev/null
+/**
+ * collection4 - dp_rrdtool.h
+ * Copyright (C) 2010 Florian octo Forster
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ * Authors:
+ * Florian octo Forster <ff at octo.it>
+ **/
+
+#ifndef DP_RRDTOOL_H
+#define DP_RRDTOOL_H 1
+
+#include "oconfig.h"
+
+int dp_rrdtool_config (const oconfig_item_t *ci);
+
+#endif /* DP_RRDTOOL_H */
+/* vim: set sw=2 sts=2 et fdm=marker : */
#include "graph_list.h"
#include "oconfig.h"
#include "common.h"
+#include "data_provider.h"
#ifndef CONFIGFILE
# define CONFIGFILE "/etc/collection.conf"
child = ci->children + i;
if (strcasecmp ("Graph", child->key) == 0)
graph_config_add (child);
+ else if (strcasecmp ("DataProvider", child->key) == 0)
+ data_provider_config (child);
else
{
DEBUG ("Unknown config option: %s", child->key);