plugin.c plugin.h \
configfile.c configfile.h
#collectd_CFLAGS = -DPLUGINDIR='"$(pkglibdir)"'
-collectd_CPPFLAGS = -DLOCALSTATEDIR='"$(localstatedir)"' -DPLUGINDIR='"$(pkglibdir)"'
+collectd_CPPFLAGS = -DLOCALSTATEDIR='"$(localstatedir)"' -DSYSCONFDIR='"$(sysconfdir)"' -DPLUGINDIR='"$(pkglibdir)"'
collectd_LDFLAGS = -export-dynamic
collectd_CFLAGS = -Werror
collectd_LDADD = $(LIBLTDL) libconfig/libconfig.la "-dlopen" self
#define PIDFILE LOCALSTATEDIR"/run/collectd.pid"
#endif
+#ifndef SYSCONFDIR
+#define SYSCONFDIR "/opt/collectd/etc"
+#endif
+
+#ifndef CONFIGFILE
+#define CONFIGFILE SYSCONFDIR"/collectd.conf"
+#endif
+
#define MODE_SERVER 0x01
#define MODE_CLIENT 0x02
#define MODE_LOCAL 0x03
}
/*
+ * Returns true if the plugin is loaded (i.e. `exists') and false otherwise.
+ * This is used in `configfile.c' to skip sections that are not needed..
+ */
+bool plugin_exists (char *type)
+{
+ if (plugin_search (type) == NULL)
+ return (false);
+ else
+ return (true);
+}
+
+/*
* (Try to) load the shared object `name'. Won't complain if it isn't a shared
* object, but it will bitch about a shared object not having a
* ``module_register'' symbol..
void plugin_init_all (void);
void plugin_read_all (void);
+bool plugin_exists (char *type);
void plugin_register (char *type,
void (*init) (void),
void (*read) (void),