X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmysql.c;fp=src%2Fmysql.c;h=312a819e4980190a13bbabd957b30ca6efcea599;hb=10075e6fe3c384b73c2dd398a1435f8d10e56654;hp=aa585d6554eb88ddedffb8f38f5286b386deeba6;hpb=9bbf7d748e3fc79ac66b496cfda50706228e7c2b;p=collectd.git diff --git a/src/mysql.c b/src/mysql.c index aa585d65..312a819e 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -128,9 +128,10 @@ static void counter_submit (const char *type, const char *type_instance, vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin)); - strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)); + sstrncpy (vl.type, type, sizeof (vl.type)); + sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)); - plugin_dispatch_values (type, &vl); + plugin_dispatch_values (&vl); } /* void counter_submit */ static void qcache_submit (counter_t hits, counter_t inserts, @@ -151,8 +152,9 @@ static void qcache_submit (counter_t hits, counter_t inserts, vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin)); + sstrncpy (vl.type, "mysql_qcache", sizeof (vl.type)); - plugin_dispatch_values ("mysql_qcache", &vl); + plugin_dispatch_values (&vl); } /* void qcache_submit */ static void threads_submit (gauge_t running, gauge_t connected, gauge_t cached, @@ -171,8 +173,9 @@ static void threads_submit (gauge_t running, gauge_t connected, gauge_t cached, vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin)); + sstrncpy (vl.type, "mysql_threads", sizeof (vl.type)); - plugin_dispatch_values ("mysql_threads", &vl); + plugin_dispatch_values (&vl); } /* void threads_submit */ static void traffic_submit (counter_t rx, counter_t tx) @@ -188,8 +191,9 @@ static void traffic_submit (counter_t rx, counter_t tx) vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin)); + sstrncpy (vl.type, "mysql_octets", sizeof (vl.type)); - plugin_dispatch_values ("mysql_octets", &vl); + plugin_dispatch_values (&vl); } /* void traffic_submit */ static int mysql_read (void)