Code

add log_logstash plugin to emit logstash json_event messages.
[collectd.git] / src / plugin.c
index 386be3262e029f1f1e2734aba154031cf8df0cf7..894b0e51d72731ba1f7faab5c032a122063e85be 100644 (file)
@@ -901,6 +901,21 @@ int plugin_load (char const *plugin_name, uint32_t flags)
        dir = plugin_get_dir ();
        ret = 1;
 
+       /*
+        * XXX: Magic at work:
+        *
+        * Some of the language bindings, for example the Python and Perl
+        * plugins, need to be able to export symbols to the scripts they run.
+        * For this to happen, the "Globals" flag needs to be set.
+        * Unfortunately, this technical detail is hard to explain to the
+        * average user and she shouldn't have to worry about this, ideally.
+        * So in order to save everyone's sanity use a different default for a
+        * handful of special plugins. --octo
+        */
+       if ((strcasecmp ("perl", plugin_name) == 0)
+                       || (strcasecmp ("python", plugin_name) == 0))
+               flags |= PLUGIN_FLAGS_GLOBAL;
+
        /* `cpu' should not match `cpufreq'. To solve this we add `.so' to the
         * type when matching the filename */
        status = ssnprintf (typename, sizeof (typename), "%s.so", plugin_name);