} /* int apache_read */
#endif /* APACHE_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&apache_bytes_ds);
- plugin_register_data_set (&apache_requests_ds);
- plugin_register_data_set (&apache_scoreboard_ds);
- plugin_register_data_set (&apache_connections_ds);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&apache_bytes_ds);
+ plugin_register_data_set (&apache_requests_ds);
+ plugin_register_data_set (&apache_scoreboard_ds);
+ plugin_register_data_set (&apache_connections_ds);
+ }
#if APACHE_HAVE_READ
- plugin_register_config ("apache", config,
- config_keys, config_keys_num);
- plugin_register_init ("apache", init);
- plugin_register_read ("apache", apache_read);
+ if (load & MR_READ)
+ {
+ plugin_register_config ("apache", config,
+ config_keys, config_keys_num);
+ plugin_register_init ("apache", init);
+ plugin_register_read ("apache", apache_read);
+ }
#endif
-}
+} /* void module_register */
return (0);
} /* apcups_read */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&ds_voltage);
- plugin_register_data_set (&ds_percent);
- plugin_register_data_set (&ds_timeleft);
- plugin_register_data_set (&ds_temperature);
- plugin_register_data_set (&ds_frequency);
-
- plugin_register_config ("apcups", apcups_config, config_keys, config_keys_num);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&ds_voltage);
+ plugin_register_data_set (&ds_percent);
+ plugin_register_data_set (&ds_timeleft);
+ plugin_register_data_set (&ds_temperature);
+ plugin_register_data_set (&ds_frequency);
+ }
- plugin_register_read ("apcups", apcups_read);
- plugin_register_shutdown ("apcups", apcups_shutdown);
-}
+ if (load & MR_READ)
+ {
+ plugin_register_config ("apcups", apcups_config, config_keys,
+ config_keys_num);
+ plugin_register_read ("apcups", apcups_read);
+ plugin_register_shutdown ("apcups", apcups_shutdown);
+ }
+} /* void module_register */
} /* int as_read */
#endif /* IOKIT_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&fanspeed_ds);
- plugin_register_data_set (&temperature_ds);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&fanspeed_ds);
+ plugin_register_data_set (&temperature_ds);
+ }
#if IOKIT_HAVE_READ
- plugin_register_init ("apple_sensors", as_init);
- plugin_register_read ("apple_sensors", as_read);
+ if (load & MR_READ)
+ {
+ plugin_register_init ("apple_sensors", as_init);
+ plugin_register_read ("apple_sensors", as_read);
+ }
#endif /* IOKIT_HAVE_READ */
-}
+} /* void module_register */
}
#endif /* BATTERY_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&charge_ds);
- plugin_register_data_set (¤t_ds);
- plugin_register_data_set (&voltage_ds);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&charge_ds);
+ plugin_register_data_set (¤t_ds);
+ plugin_register_data_set (&voltage_ds);
+ }
#if BATTERY_HAVE_READ
- plugin_register_init ("battery", battery_init);
- plugin_register_read ("battery", battery_read);
+ if (load & MR_READ)
+ {
+ plugin_register_init ("battery", battery_init);
+ plugin_register_read ("battery", battery_read);
+ }
#endif /* BATTERY_HAVE_READ */
-}
+} /* void module_register */
* Prototypes of callback functions
*/
static int dispatch_value_plugindir (const oconfig_item_t *ci);
+static int dispatch_value_loadds (const oconfig_item_t *ci);
static int dispatch_value_loadplugin (const oconfig_item_t *ci);
/*
static cf_value_map_t cf_value_map[] =
{
{"PluginDir", dispatch_value_plugindir},
- {"LoadPlugin", dispatch_value_loadplugin}
+ {"LoadPlugin", dispatch_value_loadplugin},
+ {"LoadDS", dispatch_value_loadds}
};
static int cf_value_map_num = STATIC_ARRAY_LEN (cf_value_map);
return (0);
}
+static int dispatch_value_loadds (const oconfig_item_t *ci)
+{
+ assert (strcasecmp (ci->key, "LoadDS") == 0);
+
+ if (ci->values_num != 1)
+ return (-1);
+ if (ci->values[0].type != OCONFIG_TYPE_STRING)
+ return (-1);
+
+ return (plugin_load (ci->values[0].value.string, MR_DATASETS));
+} /* int dispatch_value_loadds */
+
static int dispatch_value_loadplugin (const oconfig_item_t *ci)
{
assert (strcasecmp (ci->key, "LoadPlugin") == 0);
if (ci->values[0].type != OCONFIG_TYPE_STRING)
return (-1);
- return (plugin_load (ci->values[0].value.string));
+ return (plugin_load (ci->values[0].value.string, MR_EVERYTHING));
} /* int dispatch_value_loadplugin */
static int dispatch_value_plugin (const char *plugin, oconfig_item_t *ci)
}
#endif /* CPU_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&ds);
+ if (load & MR_DATASETS)
+ plugin_register_data_set (&ds);
#if CPU_HAVE_READ
- plugin_register_init ("cpu", init);
- plugin_register_read ("cpu", cpu_read);
+ if (load & MR_READ)
+ {
+ plugin_register_init ("cpu", init);
+ plugin_register_read ("cpu", cpu_read);
+ }
#endif /* CPU_HAVE_READ */
-}
+} /* void module_register */
#endif /* CPUFREQ_HAVE_READ */
#undef BUFSIZE
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&data_set);
+ if (load & MR_DATASETS)
+ plugin_register_data_set (&data_set);
#if CPUFREQ_HAVE_READ
- plugin_register_init ("cpufreq", cpufreq_init);
- plugin_register_read ("cpufreq", cpufreq_read);
+ if (load & MR_READ)
+ {
+ plugin_register_init ("cpufreq", cpufreq_init);
+ plugin_register_read ("cpufreq", cpufreq_read);
+ }
#endif /* CPUFREQ_HAVE_READ */
}
return (0);
} /* int csv_write */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_config ("csv", csv_config,
- config_keys, config_keys_num);
- plugin_register_write ("csv", csv_write);
-}
+ if (load & MR_WRITE)
+ {
+ plugin_register_config ("csv", csv_config,
+ config_keys, config_keys_num);
+ plugin_register_write ("csv", csv_write);
+ }
+} /* void module_register */
} /* int df_read */
#endif /* DF_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&ds);
+ if (load & MR_DATASETS)
+ plugin_register_data_set (&ds);
#if DF_HAVE_READ
- plugin_register_config ("df", df_config, config_keys, config_keys_num);
- plugin_register_init ("df", df_init);
- plugin_register_read ("df", df_read);
+ if (load & MR_READ)
+ {
+ plugin_register_config ("df", df_config,
+ config_keys, config_keys_num);
+ plugin_register_init ("df", df_init);
+ plugin_register_read ("df", df_read);
+ }
#endif
} /* void module_register */
} /* int disk_read */
#endif /* DISK_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&octets_ds);
- plugin_register_data_set (&operations_ds);
- plugin_register_data_set (&merged_ds);
- plugin_register_data_set (&time_ds);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&octets_ds);
+ plugin_register_data_set (&operations_ds);
+ plugin_register_data_set (&merged_ds);
+ plugin_register_data_set (&time_ds);
+ }
#if DISK_HAVE_READ
- plugin_register_init ("disk", disk_init);
- plugin_register_read ("disk", disk_read);
+ if (load & MR_READ)
+ {
+ plugin_register_init ("disk", disk_init);
+ plugin_register_read ("disk", disk_read);
+ }
#endif /* DISK_HAVE_READ */
-}
+} /* void module_register */
} /* int dns_read */
#endif
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&octets_ds);
- plugin_register_data_set (&qtype_ds);
- plugin_register_data_set (&opcode_ds);
- plugin_register_data_set (&rcode_ds);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&octets_ds);
+ plugin_register_data_set (&qtype_ds);
+ plugin_register_data_set (&opcode_ds);
+ plugin_register_data_set (&rcode_ds);
+ }
#if DNS_HAVE_READ
- plugin_register_config ("dns", dns_config, config_keys, config_keys_num);
- plugin_register_init ("dns", dns_init);
- plugin_register_read ("dns", dns_read);
+ if (load & MR_READ)
+ {
+ plugin_register_config ("dns", dns_config, config_keys, config_keys_num);
+ plugin_register_init ("dns", dns_init);
+ plugin_register_read ("dns", dns_read);
+ }
#endif
} /* void module_register */
return (0);
} /* int email_read */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&email_count_ds);
- plugin_register_data_set (&email_size_ds);
- plugin_register_data_set (&spam_check_ds);
- plugin_register_data_set (&spam_score_ds);
-
- plugin_register_config ("email", email_config, config_keys, config_keys_num);
- plugin_register_init ("email", email_init);
- plugin_register_read ("email", email_read);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&email_count_ds);
+ plugin_register_data_set (&email_size_ds);
+ plugin_register_data_set (&spam_check_ds);
+ plugin_register_data_set (&spam_score_ds);
+ }
+
+ if (load & MR_READ)
+ {
+ plugin_register_config ("email", email_config, config_keys, config_keys_num);
+ plugin_register_init ("email", email_init);
+ plugin_register_read ("email", email_read);
+ }
plugin_register_shutdown ("email", email_shutdown);
-} /* void module_register (void) */
+} /* void module_register */
/* vim: set sw=4 ts=4 tw=78 noexpandtab : */
-
}
#endif /* ENTROPY_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&ds);
+ if (load & MR_DATASETS)
+ plugin_register_data_set (&ds);
+
#if ENTROPY_HAVE_READ
- plugin_register_read ("entropy", entropy_read);
+ if (load & MR_READ)
+ plugin_register_read ("entropy", entropy_read);
#endif
-}
+} /* void module_register */
return (0);
} /* int exec_read */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&ds_counter);
- plugin_register_data_set (&ds_gauge);
- plugin_register_config ("exec", exec_config, config_keys, config_keys_num);
- plugin_register_read ("exec", exec_read);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&ds_counter);
+ plugin_register_data_set (&ds_gauge);
+ }
+
+ if (load & MR_READ)
+ {
+ plugin_register_config ("exec", exec_config, config_keys, config_keys_num);
+ plugin_register_read ("exec", exec_read);
+ }
} /* void module_register */
/*
/* module_register
Register collectd plugin. */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&temperature_ds);
+ if (load & MR_DATASETS)
+ plugin_register_data_set (&temperature_ds);
#if HDDTEMP_HAVE_READ
- plugin_register_config ("hddtemp", hddtemp_config,
- config_keys, config_keys_num);
- plugin_register_init ("hddtemp", hddtemp_init);
- plugin_register_read ("hddtemp", hddtemp_read);
+ if (load & MR_READ)
+ {
+ plugin_register_config ("hddtemp", hddtemp_config,
+ config_keys, config_keys_num);
+ plugin_register_init ("hddtemp", hddtemp_init);
+ plugin_register_read ("hddtemp", hddtemp_read);
+ }
#endif /* HDDTEMP_HAVE_READ */
}
} /* int interface_read */
#endif /* INTERFACE_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&octets_ds);
- plugin_register_data_set (&packets_ds);
- plugin_register_data_set (&errors_ds);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&octets_ds);
+ plugin_register_data_set (&packets_ds);
+ plugin_register_data_set (&errors_ds);
+ }
plugin_register_config ("interface", interface_config,
config_keys, config_keys_num);
+ if (load & MR_READ)
+ {
#if HAVE_LIBKSTAT
- plugin_register_init ("interface", interface_init);
+ plugin_register_init ("interface", interface_init);
#endif
-
#if INTERFACE_HAVE_READ
- plugin_register_read ("interface", interface_read);
+ plugin_register_read ("interface", interface_read);
#endif
-}
+ }
+} /* void module_register */
} /* int iptables_shutdown */
#endif /* IPTABLES_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&ipt_bytes_ds);
- plugin_register_data_set (&ipt_packets_ds);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&ipt_bytes_ds);
+ plugin_register_data_set (&ipt_packets_ds);
+ }
#if IPTABLES_HAVE_READ
- plugin_register_config ("iptables", iptables_config,
- config_keys, config_keys_num);
- plugin_register_read ("iptables", iptables_read);
- plugin_register_shutdown ("iptables", iptables_shutdown);
+ if (load & MR_READ)
+ {
+ plugin_register_config ("iptables", iptables_config,
+ config_keys, config_keys_num);
+ plugin_register_read ("iptables", iptables_read);
+ plugin_register_shutdown ("iptables", iptables_shutdown);
+ }
#endif
-}
+} /* void module_register */
#undef BUFSIZE
#undef MODULE_NAME
#include "plugin.h"
#include "configfile.h"
-#define MODULE_NAME "irq"
-
#if KERNEL_LINUX
# define IRQ_HAVE_READ 1
#else
} /* int irq_read */
#endif /* IRQ_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&ds_irq);
+ if (load & MR_DATASETS)
+ plugin_register_data_set (&ds_irq);
#if IRQ_HAVE_READ
- plugin_register_config ("irq", irq_config,
- config_keys, config_keys_num);
- plugin_register_read ("irq", irq_read);
+ if (load & MR_READ)
+ {
+ plugin_register_config ("irq", irq_config,
+ config_keys, config_keys_num);
+ plugin_register_read ("irq", irq_read);
+ }
#endif /* IRQ_HAVE_READ */
-}
+} /* void module_register */
#undef BUFSIZE
-#undef MODULE_NAME
#include "common.h"
#include "plugin.h"
-#define MODULE_NAME "load"
-
#if defined(HAVE_GETLOADAVG) || defined(KERNEL_LINUX) || defined(HAVE_LIBSTATGRAB)
# define LOAD_HAVE_READ 1
#else
}
#endif /* LOAD_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&ds);
+ if (load & MR_DATASETS)
+ plugin_register_data_set (&ds);
+
#if LOAD_HAVE_READ
- plugin_register_read ("load", load_read);
+ if (load & MR_READ)
+ plugin_register_read ("load", load_read);
#endif
-}
-
-#undef MODULE_NAME
+} /* void module_register */
return;
} /* void logfile_log (int, const char *) */
-void module_register (void)
+void module_register (modreg_e load)
{
plugin_register_config ("logfile", logfile_config,
config_keys, config_keys_num);
plugin_register_log ("logfile", logfile_log);
- return;
} /* void module_register (void) */
/* vim: set sw=4 ts=4 tw=78 noexpandtab : */
/* module_register
Register collectd plugin. */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&fanspeed_ds);
- plugin_register_data_set (&temperature_ds);
- plugin_register_data_set (&voltage_ds);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&fanspeed_ds);
+ plugin_register_data_set (&temperature_ds);
+ plugin_register_data_set (&voltage_ds);
+ }
#if MBMON_HAVE_READ
- plugin_register_config ("mbmon", mbmon_config, config_keys, config_keys_num);
- plugin_register_read ("mbmon", mbmon_read);
+ if (load & MR_READ)
+ {
+ plugin_register_config ("mbmon", mbmon_config, config_keys, config_keys_num);
+ plugin_register_read ("mbmon", mbmon_read);
+ }
#endif /* MBMON_HAVE_READ */
-}
+} /* void module_register */
}
#endif /* MEMORY_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&ds);
+ if (load & MR_DATASETS)
+ plugin_register_data_set (&ds);
#if MEMORY_HAVE_READ
- plugin_register_init ("memory", memory_init);
- plugin_register_read ("memory", memory_read);
+ if (load & MR_READ)
+ {
+ plugin_register_init ("memory", memory_init);
+ plugin_register_read ("memory", memory_read);
+ }
#endif /* MEMORY_HAVE_READ */
-}
+} /* void module_register */
}
#endif /* MULTIMETER_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&data_set);
+ if (load & MR_DATASETS)
+ plugin_register_data_set (&data_set);
#if MULTIMETER_HAVE_READ
- plugin_register_init ("multimeter", multimeter_init);
- plugin_register_read ("multimeter", multimeter_read);
- plugin_register_shutdown ("multimeter", multimeter_shutdown);
+ if (load & MR_READ)
+ {
+ plugin_register_init ("multimeter", multimeter_init);
+ plugin_register_read ("multimeter", multimeter_read);
+ plugin_register_shutdown ("multimeter", multimeter_shutdown);
+ }
#endif /* MULTIMETER_HAVE_READ */
-}
+} /* void module_register */
} /* int mysql_read */
#endif /* MYSQL_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&ds_commands);
- plugin_register_data_set (&ds_handler);
- plugin_register_data_set (&ds_qcache);
- plugin_register_data_set (&ds_threads);
- plugin_register_data_set (&ds_octets);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&ds_commands);
+ plugin_register_data_set (&ds_handler);
+ plugin_register_data_set (&ds_qcache);
+ plugin_register_data_set (&ds_threads);
+ plugin_register_data_set (&ds_octets);
+ }
#if MYSQL_HAVE_READ
- plugin_register_config ("mysql", config, config_keys, config_keys_num);
- plugin_register_read ("mysql", mysql_read);
+ if (load & MR_READ)
+ {
+ plugin_register_config ("mysql", config, config_keys, config_keys_num);
+ plugin_register_read ("mysql", mysql_read);
+ }
#endif /* MYSQL_HAVE_READ */
} /* void module_register */
return (0);
} /* int network_init */
-void module_register (void)
+void module_register (modreg_e load)
{
plugin_register_config ("network", network_config,
config_keys, config_keys_num);
plugin_register_init ("network", network_init);
-}
+} /* void module_register */
#include "common.h"
#include "plugin.h"
-#define MODULE_NAME "nfs"
-
/* #if defined(KERNEL_LINUX) || defined(HAVE_LIBKSTAT) */
#if KERNEL_LINUX
# define NFS_HAVE_READ 1
}
#endif /* NFS_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&procedure_ds);
+ if (load & MR_DATASETS)
+ plugin_register_data_set (&procedure_ds);
#if NFS_HAVE_READ
- plugin_register_read ("nfs", nfs_read);
+ if (load & MR_READ)
+ plugin_register_read ("nfs", nfs_read);
#endif
-}
-
-#undef MODULE_NAME
+} /* void module_register */
} /* int ntpd_read */
#endif /* NTPD_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&time_offset_ds);
- plugin_register_data_set (&time_dispersion_ds);
- plugin_register_data_set (&delay_ds);
- plugin_register_data_set (&frequency_offset_ds);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&time_offset_ds);
+ plugin_register_data_set (&time_dispersion_ds);
+ plugin_register_data_set (&delay_ds);
+ plugin_register_data_set (&frequency_offset_ds);
+ }
#if NTPD_HAVE_READ
- plugin_register_config ("ntpd", ntpd_config, config_keys, config_keys_num);
- plugin_register_read ("ntpd", ntpd_read);
+ if (load & MR_READ)
+ {
+ plugin_register_config ("ntpd", ntpd_config,
+ config_keys, config_keys_num);
+ plugin_register_read ("ntpd", ntpd_read);
+ }
#endif /* NTPD_HAVE_READ */
-}
+} /* void module_register */
return (0);
} /* int ping_read */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&ds);
- plugin_register_init ("ping", ping_init);
- plugin_register_read ("ping", ping_read);
- plugin_register_config ("ping", ping_config, config_keys, config_keys_num);
+ if (load & MR_DATASETS)
+ plugin_register_data_set (&ds);
+
+ if (load & MR_READ)
+ {
+ plugin_register_config ("ping", ping_config,
+ config_keys, config_keys_num);
+ plugin_register_init ("ping", ping_init);
+ plugin_register_read ("ping", ping_read);
+ }
} /* void module_register */
* object, but it will bitch about a shared object not having a
* ``module_register'' symbol..
*/
-static int plugin_load_file (char *file)
+static int plugin_load_file (char *file, modreg_e load)
{
lt_dlhandle dlh;
- void (*reg_handle) (void);
+ void (*reg_handle) (modreg_e mr);
DEBUG ("file = %s", file);
return (1);
}
- if ((reg_handle = (void (*) (void)) lt_dlsym (dlh, "module_register")) == NULL)
+ if ((reg_handle = (void (*) (modreg_e)) lt_dlsym (dlh, "module_register")) == NULL)
{
WARNING ("Couldn't find symbol ``module_register'' in ``%s'': %s\n",
file, lt_dlerror ());
return (-1);
}
- (*reg_handle) ();
+ (*reg_handle) (load);
return (0);
}
}
#define BUFSIZE 512
-int plugin_load (const char *type)
+int plugin_load (const char *type, modreg_e mr)
{
DIR *dh;
const char *dir;
continue;
}
- if (plugin_load_file (filename) == 0)
+ if (plugin_load_file (filename, mr) == 0)
{
/* success */
ret = 0;
/*
* Public data types
*/
+enum modreg
+{
+ MR_EVERYTHING = 7,
+ MR_DATASETS = 1,
+ MR_READ = 2,
+ MR_WRITE = 4
+};
+typedef enum modreg modreg_e;
+
typedef unsigned long long counter_t;
typedef double gauge_t;
* functions.
*
* ARGUMENTS
- * `type' Name of the plugin to load.
+ * `name' Name of the plugin to load.
+ * `mr' Types of functions to request from the plugin.
*
* RETURN VALUE
* Returns zero upon success, a value greater than zero if no plugin was found
* NOTES
* No attempt is made to re-load an already loaded module.
*/
-int plugin_load (const char *name);
+int plugin_load (const char *name, modreg_e mr);
void plugin_init_all (void);
void plugin_read_all (const int *loop);
} /* int ps_read */
#endif /* PROCESSES_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&state_ds);
- plugin_register_data_set (&rss_ds);
- plugin_register_data_set (&time_ds);
- plugin_register_data_set (&count_ds );
- plugin_register_data_set (&pagefaults_ds );
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&state_ds);
+ plugin_register_data_set (&rss_ds);
+ plugin_register_data_set (&time_ds);
+ plugin_register_data_set (&count_ds);
+ plugin_register_data_set (&pagefaults_ds);
+ }
#if PROCESSES_HAVE_READ
+ if (load & MR_READ)
+ {
#if HAVE_THREAD_INFO | KERNEL_LINUX
- plugin_register_config ("processes", ps_config,
- config_keys, config_keys_num);
+ plugin_register_config ("processes", ps_config,
+ config_keys, config_keys_num);
#endif
- plugin_register_init ("processes", ps_init);
- plugin_register_read ("processes", ps_read);
+ plugin_register_init ("processes", ps_init);
+ plugin_register_read ("processes", ps_read);
+ }
#endif /* PROCESSES_HAVE_READ */
-}
-
+} /* void module_register */
return (0);
} /* int rrd_init */
-void module_register (void)
+void module_register (modreg_e load)
{
plugin_register_config ("rrdtool", rrd_config,
config_keys, config_keys_num);
} /* int sensors_read */
#endif /* SENSORS_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&fanspeed_ds);
- plugin_register_data_set (&temperature_ds);
- plugin_register_data_set (&voltage_ds);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&fanspeed_ds);
+ plugin_register_data_set (&temperature_ds);
+ plugin_register_data_set (&voltage_ds);
+ }
#if SENSORS_HAVE_READ
- plugin_register_config ("sensors", sensors_config,
- config_keys, config_keys_num);
- plugin_register_read ("sensors", sensors_read);
- plugin_register_shutdown ("sensors", sensors_shutdown);
+ if (load & MR_READ)
+ {
+ plugin_register_config ("sensors", sensors_config,
+ config_keys, config_keys_num);
+ plugin_register_read ("sensors", sensors_read);
+ plugin_register_shutdown ("sensors", sensors_shutdown);
+ }
#endif
} /* void module_register */
} /* int serial_read */
#endif /* SERIAL_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&octets_ds);
+ if (load & MR_DATASETS)
+ plugin_register_data_set (&octets_ds);
#if SERIAL_HAVE_READ
- plugin_register_read ("serial", serial_read);
+ if (load & MR_READ)
+ plugin_register_read ("serial", serial_read);
#endif /* SERIAL_HAVE_READ */
-}
+} /* void module_register */
} /* int swap_read */
#endif /* SWAP_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&data_set);
+ if (load & MR_DATASETS)
+ plugin_register_data_set (&data_set);
#if SWAP_HAVE_READ
- plugin_register_init ("swap", swap_init);
- plugin_register_read ("swap", swap_read);
+ if (load & MR_READ)
+ {
+ plugin_register_init ("swap", swap_init);
+ plugin_register_read ("swap", swap_read);
+ }
#endif /* SWAP_HAVE_READ */
-}
+} /* void module_register */
return (0);
}
-void module_register (void)
+void module_register (modreg_e load)
{
plugin_register_config ("syslog", sl_config, config_keys, config_keys_num);
plugin_register_init ("syslog", sl_init);
plugin_register_log ("syslog", sl_log);
plugin_register_shutdown ("syslog", sl_shutdown);
-
- return;
} /* void module_register(void) */
}
#endif /* TAPE_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&octets_ds);
- plugin_register_data_set (&operations_ds);
- plugin_register_data_set (&merged_ds);
- plugin_register_data_set (&time_ds);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&octets_ds);
+ plugin_register_data_set (&operations_ds);
+ plugin_register_data_set (&merged_ds);
+ plugin_register_data_set (&time_ds);
+ }
#if TAPE_HAVE_READ
- plugin_register_init ("tape", tape_init);
- plugin_register_read ("tape", tape_read);
+ if (load & MR_READ)
+ {
+ plugin_register_init ("tape", tape_init);
+ plugin_register_read ("tape", tape_read);
+ }
#endif /* TAPE_HAVE_READ */
}
return (0);
}
-void module_register (void)
+void module_register (modreg_e load)
{
plugin_register_config ("unixsock", us_config,
config_keys, config_keys_num);
} /* int users_read */
#endif /* USERS_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&ds);
- plugin_register_read ("users", users_read);
- return;
+ if (load & MR_DATASETS)
+ plugin_register_data_set (&ds);
+
+#if USERS_HAVE_READ
+ if (load & MR_READ)
+ plugin_register_read ("users", users_read);
+#endif
} /* void module_register(void) */
} /* int vserver_read */
#endif /* VSERVER_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&octets_ds);
- plugin_register_data_set (&load_ds);
- plugin_register_data_set (&threads_ds);
- plugin_register_data_set (&processes_ds);
- plugin_register_data_set (&memory_ds);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&octets_ds);
+ plugin_register_data_set (&load_ds);
+ plugin_register_data_set (&threads_ds);
+ plugin_register_data_set (&processes_ds);
+ plugin_register_data_set (&memory_ds);
+ }
#if VSERVER_HAVE_READ
- plugin_register_init ("vserver", vserver_init);
- plugin_register_read ("vserver", vserver_read);
+ if (load & MR_READ)
+ {
+ plugin_register_init ("vserver", vserver_init);
+ plugin_register_read ("vserver", vserver_read);
+ }
#endif /* VSERVER_HAVE_READ */
} /* void module_register(void) */
} /* int wireless_read */
#endif /* WIRELESS_HAVE_READ */
-void module_register (void)
+void module_register (modreg_e load)
{
- plugin_register_data_set (&quality_ds);
- plugin_register_data_set (&power_ds);
- plugin_register_data_set (&noise_ds);
+ if (load & MR_DATASETS)
+ {
+ plugin_register_data_set (&quality_ds);
+ plugin_register_data_set (&power_ds);
+ plugin_register_data_set (&noise_ds);
+ }
#if WIRELESS_HAVE_READ
- plugin_register_read ("wireless", wireless_read);
+ if (load & MR_READ)
+ plugin_register_read ("wireless", wireless_read);
#endif /* WIRELESS_HAVE_READ */
-}
+} /* void module_register */