=head1 WRITING YOUR OWN PLUGINS
-Writing your own plugins is quite simply. collectd manages plugins by means of
+Writing your own plugins is quite simple. collectd manages plugins by means of
B<dispatch functions> which call the appropriate B<callback functions>
registered by the plugins. Any plugin basically consists of the implementation
of these callback functions and initializing code which registers the
B<false>. String containing of only alphanumeric characters and underscores do
not need to be quoted.
+Plugins are loaded in the order listed in this config file. It is a good idea
+to load any logging plugins first in order to catch messages from plugins
+during configuration.
+
=head1 GLOBAL OPTIONS
=over 4
=item B<SocketGroup> I<Group>
-If running as root change the group of the UNIX-socket after it has been
+If running as root change the group of the UNIX-socket after it has been
created. Defaults to B<collectd>.
=item B<SocketPerms> I<Permissions>
=item B<SocketGroup> I<Group>
-If running as root change the group of the UNIX-socket after it has been
+If running as root change the group of the UNIX-socket after it has been
created. Defaults to B<collectd>.
=item B<SocketPerms> I<Permissions>
sfree (log_file);
log_file = strdup (value);
}
- else if (0 == strcasecmp (key, "File")) {
+ else if (0 == strcasecmp (key, "Timestamp")) {
if ((strcasecmp (value, "false") == 0)
|| (strcasecmp (value, "no") == 0)
|| (strcasecmp (value, "off") == 0))
value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
- if (strcpy (type, "nginx_connections") == 0)
+ if (strcmp (type, "nginx_connections") == 0)
values[0].gauge = value;
- else if (strcpy (type, "nginx_requests") == 0)
+ else if (strcmp (type, "nginx_requests") == 0)
values[0].counter = value;
else
return;
if (cmp == 0)
{
free_node (new);
- return (-1);
+ return (1);
}
else if (cmp < 0)
{
{
avl_node_t *n;
- assert (value != NULL);
-
n = search (t, key);
if (n == NULL)
return (-1);
- *value = n->value;
+ if (value != NULL)
+ *value = n->value;
return (0);
}
* `value' Value to be stored.
*
* RETURN VALUE
- * Zero upon success and non-zero upon failure and if the key is already
- * stored in the tree.
+ * Zero upon success, non-zero otherwise. It's less than zero if an error
+ * occurred or greater than zero if the key is already stored in the tree.
*/
int avl_insert (avl_tree_t *t, void *key, void *value);
{
e->next = l->head;
l->head = e;
+
+ if (l->tail == NULL)
+ l->tail = e;
+
++(l->size);
}