plugin.c: Tell the user if a plugin could not be found.
[collectd.git] / src / plugin.c
index 248e583..acf7620 100644 (file)
@@ -133,6 +133,7 @@ static int plugin_load_file (char *file)
                const char *error = lt_dlerror ();
 
                ERROR ("lt_dlopen failed: %s", error);
+               fprintf (stderr, "lt_dlopen failed: %s\n", error);
                return (1);
        }
 
@@ -296,7 +297,7 @@ int plugin_load (const char *type)
 {
        DIR  *dh;
        const char *dir;
-       char  filename[BUFSIZE];
+       char  filename[BUFSIZE] = "";
        char  typename[BUFSIZE];
        int   typename_len;
        int   ret;
@@ -355,10 +356,17 @@ int plugin_load (const char *type)
                        ret = 0;
                        break;
                }
+               else
+               {
+                       fprintf (stderr, "Unable to load plugin %s.\n", type);
+               }
        }
 
        closedir (dh);
 
+       if (filename[0] == '\0')
+               fprintf (stderr, "Could not find plugin %s.\n", type);
+
        return (ret);
 }
 
@@ -647,10 +655,12 @@ int plugin_dispatch_values (const char *name, value_list_t *vl)
 
        ds = (data_set_t *) le->value;
 
-       DEBUG ("plugin: plugin_dispatch_values: time = %u; host = %s; "
-                       "plugin = %s; plugin_instance = %s; type = %s; "
-                       "type_instance = %s;",
-                       (unsigned int) vl->time, vl->host,
+       DEBUG ("plugin: plugin_dispatch_values: time = %u; interval = %i; "
+                       "host = %s; "
+                       "plugin = %s; plugin_instance = %s; "
+                       "type = %s; type_instance = %s;",
+                       (unsigned int) vl->time, vl->interval,
+                       vl->host,
                        vl->plugin, vl->plugin_instance,
                        ds->type, vl->type_instance);