[collectd] [PATCH] perl plugin: Respect the modreg flags in
module_register ().
Sebastian Harl
sh<span style="display: none;">.trailing-username</span>(a)<span style="display: none;">leading-domain.</span>tokkee.org
Sun Apr 22 15:47:38 CEST 2007
TODO: Pass on MR_DATASETS to perl plugins.
Signed-off-by: Sebastian Harl <sh.trailing-username(a)leading-domain.tokkee.org>
---
src/perl.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/perl.c b/src/perl.c
index d8f294f..f42708d 100644
--- a/src/perl.c
+++ b/src/perl.c
@@ -1064,7 +1064,7 @@ static void xs_init (pTHX)
/*
* Create the perl interpreter and register it with collectd.
*/
-void module_register (void)
+void module_register (modreg_e load)
{
char *embed_argv[] = { "", "-e", "bootstrap Collectd \""VERSION"\"", NULL };
int embed_argc = 3;
@@ -1097,7 +1097,10 @@ void module_register (void)
plugin_register_log ("perl", perl_log);
plugin_register_config ("perl", perl_config, config_keys, config_keys_num);
plugin_register_init ("perl", perl_init);
- plugin_register_read ("perl", perl_read);
+
+ if (load & MR_READ)
+ plugin_register_read ("perl", perl_read);
+
plugin_register_write ("perl", perl_write);
plugin_register_shutdown ("perl", perl_shutdown);
return;
--
1.4.4.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20070422/fa6e08b3/attachment.pgp
More information about the collectd
mailing list