X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fnginx.c;h=7283488f5de49189c5d6c5ac9b3df0ee31be40f1;hb=1961988253c1f5b29a52343a34d291929e84fcf1;hp=7587c1f9b5b8429f4fb7c5e1b7db0ce04a378f35;hpb=b81104a423234c04f0eb4ace0ec5e93a363c917a;p=collectd.git diff --git a/src/nginx.c b/src/nginx.c index 7587c1f9..7283488f 100644 --- a/src/nginx.c +++ b/src/nginx.c @@ -27,9 +27,9 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" -#include "configfile.h" #include @@ -210,10 +210,8 @@ static void submit (const char *type, const char *inst, long long value) return; vl.values = values; - vl.values_len = 1; - sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + vl.values_len = STATIC_ARRAY_SIZE (values); sstrncpy (vl.plugin, "nginx", sizeof (vl.plugin)); - sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance)); sstrncpy (vl.type, type, sizeof (vl.type)); if (inst != NULL) @@ -224,8 +222,6 @@ static void submit (const char *type, const char *inst, long long value) static int nginx_read (void) { - int i; - char *ptr; char *lines[16]; int lines_num = 0; @@ -263,7 +259,7 @@ static int nginx_read (void) * 16630948 16630948 31070465 * Reading: 6 Writing: 179 Waiting: 106 */ - for (i = 0; i < lines_num; i++) + for (int i = 0; i < lines_num; i++) { fields_num = strsplit (lines[i], fields, (sizeof (fields) / sizeof (fields[0])));