summaryrefslogtreecommitdiffstats
path: root/plugins/check_mysql.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_mysql.c')
-rw-r--r--plugins/check_mysql.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index 212910d..8d1f99a 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -166,21 +166,24 @@ main (int argc, char **argv)
166 while ( (row = mysql_fetch_row (res)) != NULL) { 166 while ( (row = mysql_fetch_row (res)) != NULL) {
167 int i; 167 int i;
168 168
169 for(i = 0; i < LENGTH_METRIC_UNIT - 1; i++) { 169 for(i = 0; i < LENGTH_METRIC_UNIT; i++) {
170 if (strcmp(row[0], metric_unit[i]) == 0) { 170 if (strcmp(row[0], metric_unit[i]) == 0) {
171 xasprintf(&perf, "%s %s", perf, perfdata(metric_unit[i], 171 xasprintf(&perf, "%s%s ", perf, perfdata(metric_unit[i],
172 atol(row[1]), "", FALSE, 0, FALSE, 0, FALSE, 0, FALSE, 0)); 172 atol(row[1]), "", FALSE, 0, FALSE, 0, FALSE, 0, FALSE, 0));
173 continue; 173 continue;
174 } 174 }
175 } 175 }
176 for(i = 0; i < LENGTH_METRIC_COUNTER - 1; i++) { 176 for(i = 0; i < LENGTH_METRIC_COUNTER; i++) {
177 if (strcmp(row[0], metric_counter[i]) == 0) { 177 if (strcmp(row[0], metric_counter[i]) == 0) {
178 xasprintf(&perf, "%s %s", perf, perfdata(metric_counter[i], 178 xasprintf(&perf, "%s%s ", perf, perfdata(metric_counter[i],
179 atol(row[1]), "c", FALSE, 0, FALSE, 0, FALSE, 0, FALSE, 0)); 179 atol(row[1]), "c", FALSE, 0, FALSE, 0, FALSE, 0, FALSE, 0));
180 continue; 180 continue;
181 } 181 }
182 } 182 }
183 } 183 }
184 /* remove trailing space */
185 if (strlen(perf) > 0)
186 perf[strlen(perf) - 1] = '\0';
184 } 187 }
185 188
186 if(check_slave) { 189 if(check_slave) {