[collectd] [PATCH] nginx

Saulius Grigaliunas saulius.grigaliunas at gmail.com
Wed Dec 12 15:28:55 CET 2007


Hello,

I believe I found a typo in nginx.c which prevents collectd with nginx  
plugin from working. Collectd segfaults at startup. Here is a tiny  
patch to correct the issue:

diff -pur collectd-4.2.1/src/nginx.c collectd-4.2.1-mine/src/nginx.c
--- collectd-4.2.1/src/nginx.c  2007-11-08 19:51:45.000000000 +0200
+++ collectd-4.2.1-mine/src/nginx.c     2007-12-12 14:39:21.000000000  
+0200
@@ -141,9 +141,9 @@ static void submit (char *type, char *in
    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;

When applied, everything works as expected. 



More information about the collectd mailing list