From: Florian Forster Date: Tue, 1 Sep 2009 20:49:47 +0000 (+0200) Subject: mysql plugin: Improve the `mysql_ping' warning. X-Git-Tag: collectd-4.7.3~4 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=cce535f9fbb96dce74e94c5077bae08b1be8b2c4;p=collectd.git mysql plugin: Improve the `mysql_ping' warning. --- diff --git a/src/mysql.c b/src/mysql.c index f243c500..1048511c 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -363,7 +363,11 @@ static MYSQL *getconnection (mysql_database_t *db) int err; if ((err = mysql_ping (db->con)) != 0) { - WARNING ("mysql_ping failed: %s", mysql_error (db->con)); + WARNING ("mysql_ping failed for %s: %s", + (db->instance != NULL) + ? db->instance + : "", + mysql_error (db->con)); db->state = 0; } else