Merge branch 'master' of octo@verplant.org:/var/lib/git/collectd
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 15 Dec 2007 11:11:17 +0000 (12:11 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 15 Dec 2007 11:11:17 +0000 (12:11 +0100)
src/collectd-perl.pod
src/collectd.conf.pod
src/logfile.c
src/nginx.c
src/utils_avltree.c
src/utils_avltree.h
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 09cf2e6..285dd38 100644 (file)
@@ -518,7 +518,7 @@ int avl_insert (avl_tree_t *t, void *key, void *value)
                if (cmp == 0)
                {
                        free_node (new);
-                       return (-1);
+                       return (1);
                }
                else if (cmp < 0)
                {
@@ -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 7a29a29..0fc8ea1 100644 (file)
@@ -77,8 +77,8 @@ void avl_destroy (avl_tree_t *t);
  *   `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);
 
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);
 }