Merge branch 'collectd-4.2'
authorFlorian Forster <octo@huhu.verplant.org>
Thu, 13 Dec 2007 07:16:16 +0000 (08:16 +0100)
committerFlorian Forster <octo@huhu.verplant.org>
Thu, 13 Dec 2007 07:16:16 +0000 (08:16 +0100)
Conflicts:

src/utils_llist.c

src/collectd-perl.pod
src/collectd.conf.pod
src/logfile.c
src/nginx.c
src/utils_avltree.c
src/utils_llist.c

index 3306f39..b327ef5 100644 (file)
@@ -61,7 +61,7 @@ only has effect on plugins loaded after this option.
 
 =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
index f642c96..49cccdf 100644 (file)
@@ -32,6 +32,10 @@ ignored. Values are either string, enclosed in double-quotes,
 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
@@ -252,7 +256,7 @@ Sets the socket-file which is to be created.
 
 =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>
@@ -964,7 +968,7 @@ Sets the socket-file which is to be created.
 
 =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>
index f466124..adea302 100644 (file)
@@ -72,7 +72,7 @@ static int logfile_config (const char *key, const char *value)
                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))
index 69dc49e..a44e8a5 100644 (file)
@@ -141,9 +141,9 @@ static void submit (char *type, char *inst, long long value)
   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;
index 031ec47..285dd38 100644 (file)
@@ -581,13 +581,12 @@ int avl_get (avl_tree_t *t, const void *key, void **value)
 {
        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);
 }
index f7e03c2..7fae025 100644 (file)
@@ -106,6 +106,10 @@ void llist_prepend (llist_t *l, llentry_t *e)
 {
        e->next = l->head;
        l->head = e;
+
+       if (l->tail == NULL)
+               l->tail = e;
+
        ++(l->size);
 }