projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Build system: Improve detection of the tokyotyrant library.
[collectd.git]
/
src
/
plugin.c
diff --git
a/src/plugin.c
b/src/plugin.c
index
da2e5e2
..
a5ae97b
100644
(file)
--- a/
src/plugin.c
+++ b/
src/plugin.c
@@
-573,6
+573,7
@@
int plugin_load (const char *type)
else if (!S_ISREG (statbuf.st_mode))
{
/* don't follow symlinks */
else if (!S_ISREG (statbuf.st_mode))
{
/* don't follow symlinks */
+ WARNING ("stat %s: not a regular file", filename);
continue;
}
continue;
}
@@
-690,8
+691,7
@@
int plugin_register_complex_read (const char *name,
read_heap = c_heap_create (plugin_compare_read_func);
if (read_heap == NULL)
{
read_heap = c_heap_create (plugin_compare_read_func);
if (read_heap == NULL)
{
- ERROR ("plugin_register_complex_read: "
- "c_heap_create failed.");
+ ERROR ("plugin_register_read: c_heap_create failed.");
return (-1);
}
}
return (-1);
}
}
@@
-1136,6
+1136,8
@@
int plugin_dispatch_values (value_list_t *vl)
data_set_t *ds;
data_set_t *ds;
+ int free_meta_data = 0;
+
if ((vl == NULL) || (vl->type[0] == 0)
|| (vl->values == NULL) || (vl->values_len < 1))
{
if ((vl == NULL) || (vl->type[0] == 0)
|| (vl->values == NULL) || (vl->values_len < 1))
{
@@
-1143,6
+1145,12
@@
int plugin_dispatch_values (value_list_t *vl)
return (-1);
}
return (-1);
}
+ /* Free meta data only if the calling function didn't specify any. In
+ * this case matches and targets may add some and the calling function
+ * may not expect (and therefore free) that data. */
+ if (vl->meta == NULL)
+ free_meta_data = 1;
+
if (list_write == NULL)
c_complain_once (LOG_WARNING, &no_write_complaint,
"plugin_dispatch_values: No write callback has been "
if (list_write == NULL)
c_complain_once (LOG_WARNING, &no_write_complaint,
"plugin_dispatch_values: No write callback has been "
@@
-1166,6
+1174,9
@@
int plugin_dispatch_values (value_list_t *vl)
if (vl->time == 0)
vl->time = time (NULL);
if (vl->time == 0)
vl->time = time (NULL);
+ if (vl->interval <= 0)
+ vl->interval = interval_g;
+
DEBUG ("plugin_dispatch_values: time = %u; interval = %i; "
"host = %s; "
"plugin = %s; plugin_instance = %s; "
DEBUG ("plugin_dispatch_values: time = %u; interval = %i; "
"host = %s; "
"plugin = %s; plugin_instance = %s; "
@@
-1254,6
+1265,9
@@
int plugin_dispatch_values (value_list_t *vl)
/* Update the value cache */
uc_update (ds, vl);
/* Update the value cache */
uc_update (ds, vl);
+ /* Initiate threshold checking */
+ ut_check_threshold (ds, vl);
+
if (post_cache_chain != NULL)
{
status = fc_process_chain (ds, vl, post_cache_chain);
if (post_cache_chain != NULL)
{
status = fc_process_chain (ds, vl, post_cache_chain);
@@
-1277,6
+1291,12
@@
int plugin_dispatch_values (value_list_t *vl)
vl->values_len = saved_values_len;
}
vl->values_len = saved_values_len;
}
+ if ((free_meta_data != 0) && (vl->meta != NULL))
+ {
+ meta_data_destroy (vl->meta);
+ vl->meta = NULL;
+ }
+
return (0);
} /* int plugin_dispatch_values */
return (0);
} /* int plugin_dispatch_values */