# define APACHE_HAVE_READ 0
#endif
-/* Limit to 2^27 bytes/s. That's what a gigabit-ethernet link can handle, in
- * theory. */
-static data_source_t apache_bytes_dsrc[1] =
-{
- {"count", DS_TYPE_COUNTER, 0, 134217728.0},
-};
-
-static data_set_t apache_bytes_ds =
-{
- "apache_bytes", 1, apache_bytes_dsrc
-};
-
-/* Limit to 2^20 requests/s */
-static data_source_t apache_requests_dsrc[1] =
-{
- {"count", DS_TYPE_COUNTER, 0, 134217728.0},
-};
-
-static data_set_t apache_requests_ds =
-{
- "apache_requests", 1, apache_requests_dsrc
-};
-
-static data_source_t apache_scoreboard_dsrc[1] =
-{
- {"count", DS_TYPE_GAUGE, 0, 65535.0},
-};
-
-static data_set_t apache_scoreboard_ds =
-{
- "apache_scoreboard", 1, apache_scoreboard_dsrc
-};
-
-static data_source_t apache_connections_dsrc[1] =
-{
- {"count", DS_TYPE_GAUGE, 0, 65535.0},
-};
-
-static data_set_t apache_connections_ds =
-{
- "apache_connections", 1, apache_connections_dsrc
-};
-
#if APACHE_HAVE_READ
static char *url = NULL;
static char *user = NULL;
} /* int apache_read */
#endif /* APACHE_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- 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
- 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);
- }
+ 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 */
static int global_sockfd = -1;
-/*
- * The following are only if not compiled to test the module with its own main.
-*/
-static data_source_t data_source_voltage[1] =
-{
- {"value", DS_TYPE_GAUGE, NAN, NAN}
-};
-
-static data_set_t ds_voltage =
-{
- "voltage", 1, data_source_voltage
-};
-
-static data_source_t data_source_percent[1] =
-{
- {"percent", DS_TYPE_GAUGE, 0, 100.1}
-};
-
-static data_set_t ds_percent =
-{
- "percent", 1, data_source_percent
-};
-
-static data_source_t data_source_timeleft[1] =
-{
- {"timeleft", DS_TYPE_GAUGE, 0, 100.0}
-};
-
-static data_set_t ds_timeleft =
-{
- "timeleft", 1, data_source_timeleft
-};
-
-static data_source_t data_source_temperature[1] =
-{
- {"value", DS_TYPE_GAUGE, -273.15, NAN}
-};
-
-static data_set_t ds_temperature =
-{
- "temperature", 1, data_source_temperature
-};
-
-static data_source_t data_source_frequency[1] =
-{
- {"frequency", DS_TYPE_GAUGE, 0, NAN}
-};
-
-static data_set_t ds_frequency =
-{
- "frequency", 1, data_source_frequency
-};
-
static const char *config_keys[] =
{
"Host",
return (0);
} /* apcups_read */
-void module_register (modreg_e load)
+void module_register (void)
{
- 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);
- }
-
- 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);
- }
+ 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 */
static mach_port_t io_master_port = MACH_PORT_NULL;
#endif
-static data_source_t data_source_fanspeed[1] =
-{
- {"value", DS_TYPE_GAUGE, 0, NAN}
-};
-
-static data_set_t fanspeed_ds =
-{
- "fanspeed", 1, data_source_fanspeed
-};
-
-static data_source_t data_source_temperature[1] =
-{
- {"value", DS_TYPE_GAUGE, -273.15, NAN}
-};
-
-static data_set_t temperature_ds =
-{
- "temperature", 1, data_source_temperature
-};
-
#if IOKIT_HAVE_READ
static int as_init (void)
{
} /* int as_read */
#endif /* IOKIT_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- if (load & MR_DATASETS)
- {
- plugin_register_data_set (&fanspeed_ds);
- plugin_register_data_set (&temperature_ds);
- }
-
#if IOKIT_HAVE_READ
if (load & MR_READ)
{
#define INVALID_VALUE 47841.29
-static data_source_t data_source_charge[1] =
-{
- {"value", DS_TYPE_GAUGE, 0, NAN}
-};
-
-static data_set_t charge_ds =
-{
- "charge", 1, data_source_charge
-};
-
-static data_source_t data_source_current[1] =
-{
- {"value", DS_TYPE_GAUGE, NAN, NAN}
-};
-
-static data_set_t current_ds =
-{
- "current", 1, data_source_current
-};
-
-static data_source_t data_source_voltage[1] =
-{
- {"value", DS_TYPE_GAUGE, NAN, NAN}
-};
-
-static data_set_t voltage_ds =
-{
- "voltage", 1, data_source_voltage
-};
-
#if BATTERY_HAVE_READ
#if HAVE_IOKIT_IOKITLIB_H || HAVE_IOKIT_PS_IOPOWERSOURCES_H
/* No global variables */
}
#endif /* BATTERY_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- 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
- if (load & MR_READ)
- {
- plugin_register_init ("battery", battery_init);
- plugin_register_read ("battery", battery_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},
- {"LoadDS", dispatch_value_loadds}
+ {"LoadPlugin", dispatch_value_loadplugin}
};
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, MR_EVERYTHING));
+ return (plugin_load (ci->values[0].value.string));
} /* int dispatch_value_loadplugin */
static int dispatch_value_plugin (const char *plugin, oconfig_item_t *ci)
# define CPU_HAVE_READ 0
#endif
-static data_source_t dsrc[1] =
-{
- {"value", DS_TYPE_COUNTER, 0, 4294967295.0}
-};
-
-static data_set_t ds =
-{
- "cpu", 1, dsrc
-};
-
#if CPU_HAVE_READ
#ifdef PROCESSOR_CPU_LOAD_INFO
static mach_port_t port_host;
}
#endif /* CPU_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- if (load & MR_DATASETS)
- plugin_register_data_set (&ds);
-
#if CPU_HAVE_READ
- if (load & MR_READ)
- {
- plugin_register_init ("cpu", init);
- plugin_register_read ("cpu", cpu_read);
- }
+ plugin_register_init ("cpu", init);
+ plugin_register_read ("cpu", cpu_read);
#endif /* CPU_HAVE_READ */
} /* void module_register */
# define CPUFREQ_HAVE_READ 0
#endif
-static data_source_t data_source[1] =
-{
- {"value", DS_TYPE_GAUGE, 0, NAN}
-};
-
-static data_set_t data_set =
-{
- "cpufreq", 1, data_source
-};
-
#if CPUFREQ_HAVE_READ
#ifdef KERNEL_LINUX
static int num_cpu = 0;
#endif /* CPUFREQ_HAVE_READ */
#undef BUFSIZE
-void module_register (modreg_e load)
+void module_register (void)
{
- if (load & MR_DATASETS)
- plugin_register_data_set (&data_set);
-
#if CPUFREQ_HAVE_READ
- if (load & MR_READ)
- {
- plugin_register_init ("cpufreq", cpufreq_init);
- plugin_register_read ("cpufreq", cpufreq_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 (modreg_e load)
+void module_register (void)
{
- if (load & MR_WRITE)
- {
- plugin_register_config ("csv", csv_config,
- config_keys, config_keys_num);
- plugin_register_write ("csv", csv_write);
- }
+ plugin_register_config ("csv", csv_config,
+ config_keys, config_keys_num);
+ plugin_register_write ("csv", csv_write);
} /* void module_register */
# define BLOCKSIZE(s) (s).f_bsize
#endif
-/* 2^50 - 1 == 1125899906842623 = 1 Petabyte */
-static data_source_t dsrc[2] =
-{
- {"free", DS_TYPE_GAUGE, 0, 1125899906842623.0},
- {"used", DS_TYPE_GAUGE, 0, 1125899906842623.0}
-};
-
-static data_set_t ds =
-{
- "df", 2, dsrc
-};
-
#if DF_HAVE_READ
static const char *config_keys[] =
{
} /* int df_read */
#endif /* DF_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- if (load & MR_DATASETS)
- plugin_register_data_set (&ds);
-
#if DF_HAVE_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);
- }
+ 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 */
# define DISK_HAVE_READ 0
#endif
-/* 2^34 = 17179869184 = ~17.2GByte/s */
-static data_source_t octets_dsrc[2] =
-{
- {"read", DS_TYPE_COUNTER, 0, 17179869183.0},
- {"write", DS_TYPE_COUNTER, 0, 17179869183.0}
-};
-
-static data_set_t octets_ds =
-{
- "disk_octets", 2, octets_dsrc
-};
-
-static data_source_t operations_dsrc[2] =
-{
- {"read", DS_TYPE_COUNTER, 0, 4294967295.0},
- {"write", DS_TYPE_COUNTER, 0, 4294967295.0}
-};
-
-static data_set_t operations_ds =
-{
- "disk_ops", 2, operations_dsrc
-};
-
-static data_source_t merged_dsrc[2] =
-{
- {"read", DS_TYPE_COUNTER, 0, 4294967295.0},
- {"write", DS_TYPE_COUNTER, 0, 4294967295.0}
-};
-
-static data_set_t merged_ds =
-{
- "disk_merged", 2, merged_dsrc
-};
-
-/* max is 1000000us per second. */
-static data_source_t time_dsrc[2] =
-{
- {"read", DS_TYPE_COUNTER, 0, 1000000.0},
- {"write", DS_TYPE_COUNTER, 0, 1000000.0}
-};
-
-static data_set_t time_ds =
-{
- "disk_time", 2, time_dsrc
-};
-
#if DISK_HAVE_READ
#if HAVE_IOKIT_IOKITLIB_H
static mach_port_t io_master_port = MACH_PORT_NULL;
} /* int disk_read */
#endif /* DISK_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- 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
- if (load & MR_READ)
- {
- plugin_register_init ("disk", disk_init);
- plugin_register_read ("disk", disk_read);
- }
+ plugin_register_init ("disk", disk_init);
+ plugin_register_read ("disk", disk_read);
#endif /* DISK_HAVE_READ */
} /* void module_register */
/*
* Private variables
*/
-static data_source_t octets_dsrc[2] =
-{
- {"queries", DS_TYPE_COUNTER, 0, 125000000.0},
- {"responses", DS_TYPE_COUNTER, 0, 125000000.0}
-};
-
-static data_set_t octets_ds =
-{
- "dns_octets", 2, octets_dsrc
-};
-
-static data_source_t counter_dsrc[1] =
-{
- {"value", DS_TYPE_COUNTER, 0, 65535.0}
-};
-
-static data_set_t qtype_ds =
-{
- "dns_qtype", 1, counter_dsrc
-};
-
-static data_set_t opcode_ds =
-{
- "dns_opcode", 1, counter_dsrc
-};
-
-static data_set_t rcode_ds =
-{
- "dns_rcode", 1, counter_dsrc
-};
-
#if DNS_HAVE_READ
static const char *config_keys[] =
{
} /* int dns_read */
#endif
-void module_register (modreg_e load)
+void module_register (void)
{
- 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
- 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);
- }
+ 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 */
};
static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
-static data_source_t gauge_dsrc[1] =
-{
- {"value", DS_TYPE_GAUGE, 0.0, NAN}
-};
-
-static data_set_t email_count_ds =
-{
- "email_count", 1, gauge_dsrc
-};
-
-static data_set_t email_size_ds =
-{
- "email_size", 1, gauge_dsrc
-};
-
-static data_set_t spam_check_ds =
-{
- "spam_check", 1, gauge_dsrc
-};
-
-static data_source_t spam_score_dsrc[1] =
-{
- {"score", DS_TYPE_GAUGE, NAN, NAN}
-};
-
-static data_set_t spam_score_ds =
-{
- "spam_score", 1, spam_score_dsrc
-};
-
/* socket configuration */
static char *sock_group = COLLECTD_GRP_NAME;
static int sock_perms = S_IRWXU | S_IRWXG;
return (0);
} /* int email_read */
-void module_register (modreg_e load)
+void module_register (void)
{
- 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_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 */
#define ENTROPY_FILE "/proc/sys/kernel/random/entropy_avail"
-static data_source_t dsrc[1] =
-{
- {"entropy", DS_TYPE_GAUGE, 0.0, 4294967295.0}
-};
-
-static data_set_t ds =
-{
- "entropy", 1, dsrc
-};
-
#if ENTROPY_HAVE_READ
static void entropy_submit (double entropy)
{
}
#endif /* ENTROPY_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- if (load & MR_DATASETS)
- plugin_register_data_set (&ds);
-
#if ENTROPY_HAVE_READ
- if (load & MR_READ)
- plugin_register_read ("entropy", entropy_read);
+ plugin_register_read ("entropy", entropy_read);
#endif
} /* void module_register */
/*
* Private variables
*/
-static data_source_t dsrc_counter[1] =
-{
- {"value", DS_TYPE_COUNTER, NAN, NAN}
-};
-
-static data_set_t ds_counter =
-{
- "counter", STATIC_ARRAY_SIZE (dsrc_counter), dsrc_counter
-};
-
-static data_source_t dsrc_gauge[1] =
-{
- {"value", DS_TYPE_GAUGE, NAN, NAN}
-};
-
-static data_set_t ds_gauge =
-{
- "gauge", STATIC_ARRAY_SIZE (dsrc_gauge), dsrc_gauge
-};
-
static const char *config_keys[] =
{
"Exec"
return (0);
} /* int exec_shutdown */
-void module_register (modreg_e load)
+void module_register (void)
{
- 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);
- plugin_register_shutdown ("exec", exec_shutdown);
- }
+ plugin_register_config ("exec", exec_config, config_keys, config_keys_num);
+ plugin_register_read ("exec", exec_read);
+ plugin_register_shutdown ("exec", exec_shutdown);
} /* void module_register */
/*
#define HDDTEMP_DEF_HOST "127.0.0.1"
#define HDDTEMP_DEF_PORT "7634"
-static data_source_t data_source_temperature[1] =
-{
- {"value", DS_TYPE_GAUGE, -273.15, NAN}
-};
-
-static data_set_t temperature_ds =
-{
- "temperature", 1, data_source_temperature
-};
-
#if HDDTEMP_HAVE_READ
static const char *config_keys[] =
{
/* module_register
Register collectd plugin. */
-void module_register (modreg_e load)
+void module_register (void)
{
- if (load & MR_DATASETS)
- plugin_register_data_set (&temperature_ds);
-
#if HDDTEMP_HAVE_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);
- }
+ 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 */
}
/*
* (Module-)Global variables
*/
-/* 2^32 = 4294967296 = ~4.2GByte/s = ~34GBit/s */
-static data_source_t octets_dsrc[2] =
-{
- {"rx", DS_TYPE_COUNTER, 0, 4294967295.0},
- {"tx", DS_TYPE_COUNTER, 0, 4294967295.0}
-};
-
-static data_set_t octets_ds =
-{
- "if_octets", 2, octets_dsrc
-};
-
-static data_source_t packets_dsrc[2] =
-{
- {"rx", DS_TYPE_COUNTER, 0, 4294967295.0},
- {"tx", DS_TYPE_COUNTER, 0, 4294967295.0}
-};
-
-static data_set_t packets_ds =
-{
- "if_packets", 2, packets_dsrc
-};
-
-static data_source_t errors_dsrc[2] =
-{
- {"rx", DS_TYPE_COUNTER, 0, 4294967295.0},
- {"tx", DS_TYPE_COUNTER, 0, 4294967295.0}
-};
-
-static data_set_t errors_ds =
-{
- "if_errors", 2, errors_dsrc
-};
-
static const char *config_keys[] =
{
"Interface",
} /* int interface_read */
#endif /* INTERFACE_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- 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 */
* them Although other collectd models don't seem to care much for options
* eitherway for what to log
*/
-/* Limit to ~125MByte/s (~1GBit/s) */
-static data_source_t dsrc[1] =
-{
- {"value", DS_TYPE_COUNTER, 0.0, 134217728.0}
-};
-
-static data_set_t ipt_bytes_ds =
-{
- "ipt_bytes", 1, dsrc
-};
-
-static data_set_t ipt_packets_ds =
-{
- "ipt_packets", 1, dsrc
-};
-
#if IPTABLES_HAVE_READ
/*
* Config format should be `Chain table chainname',
} /* int iptables_shutdown */
#endif /* IPTABLES_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- if (load & MR_DATASETS)
- {
- plugin_register_data_set (&ipt_bytes_ds);
- plugin_register_data_set (&ipt_packets_ds);
- }
-
#if IPTABLES_HAVE_READ
- 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);
- }
+ 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 */
/*
* (Module-)Global variables
*/
-static data_source_t dsrc_irq[1] =
-{
- {"value", DS_TYPE_COUNTER, 0, 65535.0}
-};
-
-static data_set_t ds_irq =
-{
- "irq", 1, dsrc_irq
-};
-
#if IRQ_HAVE_READ
static const char *config_keys[] =
{
} /* int irq_read */
#endif /* IRQ_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- if (load & MR_DATASETS)
- plugin_register_data_set (&ds_irq);
-
#if IRQ_HAVE_READ
- if (load & MR_READ)
- {
- plugin_register_config ("irq", irq_config,
- config_keys, config_keys_num);
- plugin_register_read ("irq", irq_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 */
#endif
#endif /* defined(HAVE_GETLOADAVG) */
-static data_source_t dsrc[3] =
-{
- {"shortterm", DS_TYPE_GAUGE, 0.0, 100.0},
- {"midterm", DS_TYPE_GAUGE, 0.0, 100.0},
- {"longterm", DS_TYPE_GAUGE, 0.0, 100.0}
-};
-
-static data_set_t ds =
-{
- "load", 3, dsrc
-};
-
#if LOAD_HAVE_READ
static void load_submit (gauge_t snum, gauge_t mnum, gauge_t lnum)
{
}
#endif /* LOAD_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- if (load & MR_DATASETS)
- plugin_register_data_set (&ds);
-
#if LOAD_HAVE_READ
- if (load & MR_READ)
- plugin_register_read ("load", load_read);
+ plugin_register_read ("load", load_read);
#endif
} /* void module_register */
return;
} /* void logfile_log (int, const char *) */
-void module_register (modreg_e load)
+void module_register (void)
{
plugin_register_config ("logfile", logfile_config,
config_keys, config_keys_num);
#define MBMON_DEF_HOST "127.0.0.1"
#define MBMON_DEF_PORT "411" /* the default for Debian */
-static data_source_t data_source_fanspeed[1] =
-{
- {"value", DS_TYPE_GAUGE, 0, NAN}
-};
-
-static data_set_t fanspeed_ds =
-{
- "fanspeed", 1, data_source_fanspeed
-};
-
-static data_source_t data_source_temperature[1] =
-{
- {"value", DS_TYPE_GAUGE, -273.15, NAN}
-};
-
-static data_set_t temperature_ds =
-{
- "temperature", 1, data_source_temperature
-};
-
-static data_source_t data_source_voltage[1] =
-{
- {"voltage", DS_TYPE_GAUGE, NAN, NAN}
-};
-
-static data_set_t voltage_ds =
-{
- "voltage", 1, data_source_voltage
-};
-
static const char *config_keys[] =
{
"Host",
/* module_register
Register collectd plugin. */
-void module_register (modreg_e load)
+void module_register (void)
{
- 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
- if (load & MR_READ)
- {
- plugin_register_config ("mbmon", mbmon_config, config_keys, config_keys_num);
- plugin_register_read ("mbmon", mbmon_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 */
# define MEMORY_HAVE_READ 0
#endif
-/* 2^48 = 281474976710656 */
-static data_source_t dsrc[4] =
-{
- {"value", DS_TYPE_GAUGE, 0, 281474976710656.0}
-};
-
-static data_set_t ds =
-{
- "memory", 1, dsrc
-};
-
/* vm_statistics_data_t */
#if defined(HOST_VM_INFO)
static mach_port_t port_host;
}
#endif /* MEMORY_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- if (load & MR_DATASETS)
- plugin_register_data_set (&ds);
-
#if MEMORY_HAVE_READ
- if (load & MR_READ)
- {
- plugin_register_init ("memory", memory_init);
- plugin_register_read ("memory", memory_read);
- }
+ plugin_register_init ("memory", memory_init);
+ plugin_register_read ("memory", memory_read);
#endif /* MEMORY_HAVE_READ */
} /* void module_register */
# error "multimeter cannot read!"
#endif
-static data_source_t data_source[1] =
-{
- {"value", DS_TYPE_GAUGE, NAN, NAN}
-};
-
-static data_set_t data_set =
-{
- "multimeter", 1, data_source
-};
-
#if MULTIMETER_HAVE_READ
static int fd = -1;
}
#endif /* MULTIMETER_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- if (load & MR_DATASETS)
- plugin_register_data_set (&data_set);
-
#if MULTIMETER_HAVE_READ
- if (load & MR_READ)
- {
- plugin_register_init ("multimeter", multimeter_init);
- plugin_register_read ("multimeter", multimeter_read);
- plugin_register_shutdown ("multimeter", multimeter_shutdown);
- }
+ 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 */
/* TODO: Understand `Select_*' and possibly do that stuff as well.. */
-static data_source_t data_source_counter[1] =
-{
- {"value", DS_TYPE_COUNTER, 0, NAN}
-};
-
-static data_set_t ds_commands =
-{
- "mysql_commands", 1, data_source_counter
-};
-
-static data_set_t ds_handler =
-{
- "mysql_handler", 1, data_source_counter
-};
-
-static data_source_t data_source_qcache[5] =
-{
- {"hits", DS_TYPE_COUNTER, 0, NAN},
- {"inserts", DS_TYPE_COUNTER, 0, NAN},
- {"not_cached", DS_TYPE_COUNTER, 0, NAN},
- {"lowmem_prunes", DS_TYPE_COUNTER, 0, NAN},
- {"queries_in_cache", DS_TYPE_GAUGE, 0, NAN}
-};
-
-static data_set_t ds_qcache =
-{
- "mysql_qcache", 5, data_source_qcache
-};
-
-static data_source_t data_source_threads[4] =
-{
- {"running", DS_TYPE_GAUGE, 0, NAN},
- {"connected", DS_TYPE_GAUGE, 0, NAN},
- {"cached", DS_TYPE_GAUGE, 0, NAN},
- {"created", DS_TYPE_COUNTER, 0, NAN}
-};
-
-static data_set_t ds_threads =
-{
- "mysql_threads", 4, data_source_threads
-};
-
-static data_source_t data_source_octets[2] =
-{
- {"rx", DS_TYPE_COUNTER, 0, 4294967295.0},
- {"tx", DS_TYPE_COUNTER, 0, 4294967295.0}
-};
-
-static data_set_t ds_octets =
-{
- "mysql_octets", 2, data_source_octets
-};
-
#if MYSQL_HAVE_READ
static const char *config_keys[] =
{
} /* int mysql_read */
#endif /* MYSQL_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- 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
- if (load & MR_READ)
- {
- plugin_register_config ("mysql", config, config_keys, config_keys_num);
- plugin_register_read ("mysql", mysql_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 (modreg_e load)
+void module_register (void)
{
plugin_register_config ("network", network_config,
config_keys, config_keys_num);
21 commit
*/
-static data_source_t procedure_dsrc[1] =
-{
- {"value", DS_TYPE_COUNTER, 0, 4294967295.0}
-};
-
-static data_set_t procedure_ds =
-{
- "nfs_procedure", 1, procedure_dsrc
-};
-
#if NFS_HAVE_READ
static const char *nfs2_procedures_names[] =
{
}
#endif /* NFS_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- if (load & MR_DATASETS)
- plugin_register_data_set (&procedure_ds);
-
#if NFS_HAVE_READ
- if (load & MR_READ)
- plugin_register_read ("nfs", nfs_read);
+ plugin_register_read ("nfs", nfs_read);
#endif
} /* void module_register */
# include <poll.h>
#endif
-static data_source_t seconds_dsrc[1] =
-{
- {"seconds", DS_TYPE_GAUGE, -1000000.0, 1000000.0}
-};
-
-static data_set_t time_offset_ds =
-{
- "time_offset", 1, seconds_dsrc
-};
-
-static data_set_t time_dispersion_ds =
-{
- "time_dispersion", 1, seconds_dsrc
-};
-
-static data_set_t delay_ds =
-{
- "delay", 1, seconds_dsrc
-};
-
-static data_source_t ppm_dsrc[1] =
-{
- {"ppm", DS_TYPE_GAUGE, -1000000.0, 1000000.0}
-};
-
-static data_set_t frequency_offset_ds =
-{
- "frequency_offset", 1, ppm_dsrc
-};
-
static const char *config_keys[] =
{
"Host",
} /* int ntpd_read */
#endif /* NTPD_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- 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
- if (load & MR_READ)
- {
- plugin_register_config ("ntpd", ntpd_config,
- config_keys, config_keys_num);
- plugin_register_read ("ntpd", ntpd_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 */
# define NUT_HAVE_READ 0
#endif
-static data_source_t data_source_current[1] =
-{
- {"value", DS_TYPE_GAUGE, NAN, NAN}
-};
-
-static data_set_t ds_current =
-{
- "current", 1, data_source_current
-};
-
-static data_source_t data_source_humidity[1] =
-{
- {"value", DS_TYPE_GAUGE, 0.0, 100.0}
-};
-
-static data_set_t ds_humidity =
-{
- "humidity", 1, data_source_humidity
-};
-
-static data_source_t data_source_power[1] =
-{
- {"value", DS_TYPE_GAUGE, 0.0, NAN}
-};
-
-static data_set_t ds_power =
-{
- "power", 1, data_source_power
-};
-
-static data_source_t data_source_voltage[1] =
-{
- {"value", DS_TYPE_GAUGE, NAN, NAN}
-};
-
-static data_set_t ds_voltage =
-{
- "voltage", 1, data_source_voltage
-};
-
-static data_source_t data_source_percent[1] =
-{
- {"percent", DS_TYPE_GAUGE, 0, 100.1}
-};
-
-static data_set_t ds_percent =
-{
- "percent", 1, data_source_percent
-};
-
-static data_source_t data_source_timeleft[1] =
-{
- {"timeleft", DS_TYPE_GAUGE, 0, 100.0}
-};
-
-static data_set_t ds_timeleft =
-{
- "timeleft", 1, data_source_timeleft
-};
-
-static data_source_t data_source_temperature[1] =
-{
- {"value", DS_TYPE_GAUGE, -273.15, NAN}
-};
-
-static data_set_t ds_temperature =
-{
- "temperature", 1, data_source_temperature
-};
-
-static data_source_t data_source_frequency[1] =
-{
- {"frequency", DS_TYPE_GAUGE, 0, NAN}
-};
-
-static data_set_t ds_frequency =
-{
- "frequency", 1, data_source_frequency
-};
-
#if NUT_HAVE_READ
struct nut_ups_s;
typedef struct nut_ups_s nut_ups_t;
} /* int nut_shutdown */
#endif /* NUT_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- if (load & MR_DATASETS)
- {
- plugin_register_data_set (&ds_current);
- plugin_register_data_set (&ds_humidity);
- plugin_register_data_set (&ds_power);
- 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);
- }
-
#if NUT_HAVE_READ
- if (load & MR_READ)
- {
- plugin_register_config ("nut", nut_config, config_keys, config_keys_num);
- plugin_register_read ("nut", nut_read);
- plugin_register_shutdown ("nut", nut_shutdown);
- }
+ plugin_register_config ("nut", nut_config, config_keys, config_keys_num);
+ plugin_register_read ("nut", nut_read);
+ plugin_register_shutdown ("nut", nut_shutdown);
#endif
} /* void module_register */
/*
* Create the perl interpreter and register it with collectd.
*/
-void module_register (modreg_e load)
+void module_register (void)
{
char *embed_argv[] = { "", "-e", "bootstrap Collectd \""VERSION"\"", NULL };
int embed_argc = 3;
plugin_register_config ("perl", perl_config, config_keys, config_keys_num);
plugin_register_init ("perl", perl_init);
- if (load & MR_READ)
- plugin_register_read ("perl", perl_read);
+ plugin_register_read ("perl", perl_read);
plugin_register_write ("perl", perl_write);
plugin_register_shutdown ("perl", perl_shutdown);
static pingobj_t *pingobj = NULL;
static hostlist_t *hosts = NULL;
-static data_source_t dsrc[1] =
-{
- {"ping", DS_TYPE_GAUGE, 0, 65535.0},
-};
-
-static data_set_t ds =
-{
- "ping", 1, dsrc
-};
-
static const char *config_keys[] =
{
"Host",
return (number_of_hosts == 0 ? -1 : 0);
} /* int ping_read */
-void module_register (modreg_e load)
+void module_register (void)
{
- 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);
- }
+ 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, modreg_e load)
+static int plugin_load_file (char *file)
{
lt_dlhandle dlh;
- void (*reg_handle) (modreg_e mr);
+ void (*reg_handle) (void);
DEBUG ("file = %s", file);
return (1);
}
- if ((reg_handle = (void (*) (modreg_e)) lt_dlsym (dlh, "module_register")) == NULL)
+ if ((reg_handle = (void (*) (void)) lt_dlsym (dlh, "module_register")) == NULL)
{
WARNING ("Couldn't find symbol ``module_register'' in ``%s'': %s\n",
file, lt_dlerror ());
return (-1);
}
- (*reg_handle) (load);
+ (*reg_handle) ();
return (0);
}
}
#define BUFSIZE 512
-int plugin_load (const char *type, modreg_e mr)
+int plugin_load (const char *type)
{
DIR *dh;
const char *dir;
continue;
}
- if (plugin_load_file (filename, mr) == 0)
+ if (plugin_load_file (filename) == 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;
* NOTES
* No attempt is made to re-load an already loaded module.
*/
-int plugin_load (const char *name, modreg_e mr);
+int plugin_load (const char *name);
void plugin_init_all (void);
void plugin_read_all (const int *loop);
#define BUFSIZE 256
-static data_source_t state_dsrc[1] =
-{
- {"value", DS_TYPE_GAUGE, 0.0, 65535.0}
-};
-
-static data_set_t state_ds =
-{
- "ps_state", 1, state_dsrc
-};
-
-static data_source_t rss_dsrc[1] =
-{
- /* max = 2^63 - 1 */
- {"value", DS_TYPE_GAUGE, 0.0, 9223372036854775807.0}
-};
-
-static data_set_t rss_ds =
-{
- "ps_rss", 1, rss_dsrc
-};
-
-static data_source_t time_dsrc[2] =
-{
- /* 1 second in user-mode per second ought to be enough.. */
- {"user", DS_TYPE_COUNTER, 0.0, 1000000.0},
- {"syst", DS_TYPE_COUNTER, 0.0, 1000000.0}
-};
-
-static data_set_t time_ds =
-{
- "ps_cputime", 2, time_dsrc
-};
-
-static data_source_t count_dsrc[2] =
-{
- /* 1 second in user-mode per second ought to be enough.. */
- {"processes", DS_TYPE_GAUGE, 0.0, 1000000.0},
- {"threads", DS_TYPE_GAUGE, 0.0, 1000000.0}
-};
-
-static data_set_t count_ds =
-{
- "ps_count", 2, count_dsrc
-};
-
-static data_source_t pagefaults_dsrc[2] =
-{
- /* max = 2^63 - 1 */
- {"minflt", DS_TYPE_COUNTER, 0.0, 9223372036854775807.0},
- {"majflt", DS_TYPE_COUNTER, 0.0, 9223372036854775807.0}
-};
-
-static data_set_t pagefaults_ds =
-{
- "ps_pagefaults", 2, pagefaults_dsrc
-};
-
#if PROCESSES_HAVE_READ
#if HAVE_THREAD_INFO | KERNEL_LINUX
static const char *config_keys[] =
} /* int ps_read */
#endif /* PROCESSES_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- 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 (modreg_e load)
+void module_register (void)
{
plugin_register_config ("rrdtool", rrd_config,
config_keys, config_keys_num);
# define SENSORS_HAVE_READ 0
#endif
-static data_source_t data_source_fanspeed[1] =
-{
- {"value", DS_TYPE_GAUGE, 0, NAN}
-};
-
-static data_set_t fanspeed_ds =
-{
- "fanspeed", 1, data_source_fanspeed
-};
-
-static data_source_t data_source_temperature[1] =
-{
- {"value", DS_TYPE_GAUGE, -273.15, NAN}
-};
-
-static data_set_t temperature_ds =
-{
- "temperature", 1, data_source_temperature
-};
-
-static data_source_t data_source_voltage[1] =
-{
- {"value", DS_TYPE_GAUGE, NAN, NAN}
-};
-
-static data_set_t voltage_ds =
-{
- "voltage", 1, data_source_voltage
-};
-
#if SENSORS_HAVE_READ
#define SENSOR_TYPE_VOLTAGE 0
#define SENSOR_TYPE_FANSPEED 1
} /* int sensors_read */
#endif /* SENSORS_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- 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
- 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);
- }
+ 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 */
# define SERIAL_HAVE_READ 0
#endif
-static data_source_t octets_dsrc[2] =
-{
- {"rx", DS_TYPE_COUNTER, 0, 4294967295.0},
- {"tx", DS_TYPE_COUNTER, 0, 4294967295.0}
-};
-
-static data_set_t octets_ds =
-{
- "serial_octets", 2, octets_dsrc
-};
-
#if SERIAL_HAVE_READ
static void serial_submit (const char *type_instance,
counter_t rx, counter_t tx)
} /* int serial_read */
#endif /* SERIAL_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- if (load & MR_DATASETS)
- plugin_register_data_set (&octets_ds);
-
#if SERIAL_HAVE_READ
- if (load & MR_READ)
- plugin_register_read ("serial", serial_read);
+ plugin_register_read ("serial", serial_read);
#endif /* SERIAL_HAVE_READ */
} /* void module_register */
#undef MAX
#define MAX(x,y) ((x) > (y) ? (x) : (y))
-static data_source_t data_source[1] =
-{
- {"value", DS_TYPE_GAUGE, 0, 1099511627776.0}
-};
-
-static data_set_t data_set =
-{
- "swap", 1, data_source
-};
-
#if SWAP_HAVE_READ
#if KERNEL_LINUX
/* No global variables */
} /* int swap_read */
#endif /* SWAP_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- if (load & MR_DATASETS)
- plugin_register_data_set (&data_set);
-
#if SWAP_HAVE_READ
- if (load & MR_READ)
- {
- plugin_register_init ("swap", swap_init);
- plugin_register_read ("swap", swap_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 (modreg_e load)
+void module_register (void)
{
plugin_register_config ("syslog", sl_config, config_keys, config_keys_num);
plugin_register_init ("syslog", sl_init);
# define TAPE_HAVE_READ 0
#endif
-/* 2^34 = 17179869184 = ~17.2GByte/s */
-static data_source_t octets_dsrc[2] =
-{
- {"read", DS_TYPE_COUNTER, 0, 17179869183.0},
- {"write", DS_TYPE_COUNTER, 0, 17179869183.0}
-};
-
-static data_set_t octets_ds =
-{
- "tape_octets", 2, octets_dsrc
-};
-
-static data_source_t operations_dsrc[2] =
-{
- {"read", DS_TYPE_COUNTER, 0, 4294967295.0},
- {"write", DS_TYPE_COUNTER, 0, 4294967295.0}
-};
-
-static data_set_t operations_ds =
-{
- "tape_ops", 2, operations_dsrc
-};
-
-static data_source_t merged_dsrc[2] =
-{
- {"read", DS_TYPE_COUNTER, 0, 4294967295.0},
- {"write", DS_TYPE_COUNTER, 0, 4294967295.0}
-};
-
-static data_set_t merged_ds =
-{
- "tape_merged", 2, merged_dsrc
-};
-
-/* max is 1000000us per second. */
-static data_source_t time_dsrc[2] =
-{
- {"read", DS_TYPE_COUNTER, 0, 1000000.0},
- {"write", DS_TYPE_COUNTER, 0, 1000000.0}
-};
-
-static data_set_t time_ds =
-{
- "tape_time", 2, time_dsrc
-};
-
#if TAPE_HAVE_READ
#if defined(HAVE_LIBKSTAT)
#define MAX_NUMTAPE 256
}
#endif /* TAPE_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- 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
- if (load & MR_READ)
- {
- plugin_register_init ("tape", tape_init);
- plugin_register_read ("tape", tape_read);
- }
+ plugin_register_init ("tape", tape_init);
+ plugin_register_read ("tape", tape_read);
#endif /* TAPE_HAVE_READ */
}
return (0);
}
-void module_register (modreg_e load)
+void module_register (void)
{
plugin_register_config ("unixsock", us_config,
config_keys, config_keys_num);
# define USERS_HAVE_READ 0
#endif
-static data_source_t dsrc[1] =
-{
- {"users", DS_TYPE_GAUGE, 0.0, 65535.0}
-};
-
-static data_set_t ds =
-{
- "users", 1, dsrc
-};
-
#if USERS_HAVE_READ
static void users_submit (gauge_t value)
{
} /* int users_read */
#endif /* USERS_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- if (load & MR_DATASETS)
- plugin_register_data_set (&ds);
-
#if USERS_HAVE_READ
- if (load & MR_READ)
- plugin_register_read ("users", users_read);
+ plugin_register_read ("users", users_read);
#endif
} /* void module_register(void) */
# define VSERVER_HAVE_READ 0
#endif /* defined(KERNEL_LINUX) */
-static data_source_t octets_dsrc[2] =
-{
- {"rx", DS_TYPE_COUNTER, 0, 4294967295.0},
- {"tx", DS_TYPE_COUNTER, 0, 4294967295.0}
-};
-
-static data_set_t octets_ds =
-{
- "if_octets", 2, octets_dsrc
-};
-
-static data_source_t load_dsrc[3] =
-{
- {"shortterm", DS_TYPE_GAUGE, 0.0, 100.0},
- {"midterm", DS_TYPE_GAUGE, 0.0, 100.0},
- {"longterm", DS_TYPE_GAUGE, 0.0, 100.0}
-};
-
-static data_set_t load_ds =
-{
- "load", 3, load_dsrc
-};
-
-static data_source_t threads_dsrc[1] =
-{
- {"value", DS_TYPE_GAUGE, 0.0, 65535.0}
-};
-
-static data_set_t threads_ds =
-{
- "vs_threads", 1, threads_dsrc
-};
-
-static data_source_t processes_dsrc[1] =
-{
- {"value", DS_TYPE_GAUGE, 0.0, 65535.0}
-};
-
-static data_set_t processes_ds =
-{
- "vs_processes", 1, processes_dsrc
-};
-
-static data_source_t memory_dsrc[1] =
-{
- {"value", DS_TYPE_GAUGE, 0.0, 9223372036854775807.0}
-};
-
-static data_set_t memory_ds =
-{
- "vs_memory", 1, memory_dsrc
-};
-
#if VSERVER_HAVE_READ
static int pagesize = 0;
} /* int vserver_read */
#endif /* VSERVER_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- 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
- if (load & MR_READ)
- {
- plugin_register_init ("vserver", vserver_init);
- plugin_register_read ("vserver", vserver_read);
- }
+ plugin_register_init ("vserver", vserver_init);
+ plugin_register_read ("vserver", vserver_read);
#endif /* VSERVER_HAVE_READ */
} /* void module_register(void) */
#define WIRELESS_PROC_FILE "/proc/net/wireless"
-static data_source_t data_source_quality[1] =
-{
- {"value", DS_TYPE_GAUGE, 0, NAN}
-};
-
-static data_set_t quality_ds =
-{
- "signal_quality", 1, data_source_quality
-};
-
-static data_source_t data_source_signal[1] =
-{
- {"value", DS_TYPE_GAUGE, NAN, 0}
-};
-
-static data_set_t power_ds =
-{
- "signal_power", 1, data_source_signal
-};
-
-static data_set_t noise_ds =
-{
- "signal_noise", 1, data_source_signal
-};
-
#if WIRELESS_HAVE_READ
#if 0
static double wireless_dbm_to_watt (double dbm)
} /* int wireless_read */
#endif /* WIRELESS_HAVE_READ */
-void module_register (modreg_e load)
+void module_register (void)
{
- 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
- if (load & MR_READ)
- plugin_register_read ("wireless", wireless_read);
+ plugin_register_read ("wireless", wireless_read);
#endif /* WIRELESS_HAVE_READ */
} /* void module_register */