From 4daf780897232aa0527ae490d2821cf5fe44d097 Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Tue, 10 Nov 2020 10:29:38 +0900 Subject: [PATCH] lua: Add functions to register some missing callbacks * register_init * register_shutdown * register_config In this version, the configuration for each Script is supported. Script "foo.lua" Script "bar.lua" Key1 Value1 Key2 Value2 The scope of accessible key-value pair is limited to under This feature is similar to collectd-python. ref. https://www.collectd.org/documentation/manpages/collectd-python.html Signed-off-by: Kentaro Hayashi --- src/collectd-lua.pod | 47 +++++++ src/lua.c | 284 +++++++++++++++++++++++++++++++++++++++++++ src/utils_lua.c | 69 +++++++++++ src/utils_lua.h | 2 + 4 files changed, 402 insertions(+) diff --git a/src/collectd-lua.pod b/src/collectd-lua.pod index eccd71fb1..88aeda9d6 100644 --- a/src/collectd-lua.pod +++ b/src/collectd-lua.pod @@ -22,6 +22,12 @@ collectd-lua - Documentation of collectd's C BasePath "/path/to/your/lua/scripts" Script "script1.lua" Script "script2.lua" + + Key1 Value1 + + + Key2 Value2 + =head1 DESCRIPTION @@ -52,6 +58,16 @@ If set, this is also prepended to B. The script the C is going to run. If B is not specified, this needs to be an absolute path. +=item B I + +The definition of module variables which will be passed to Script I config function. +The concept is similar to L C. +The matched B