From: Pierre-Yves Ritschard Date: Tue, 29 Jul 2014 15:06:20 +0000 (+0200) Subject: Merge pull request #313 from tiwilliam/master X-Git-Tag: collectd-5.5.0~252 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f7818fbc069c641e1ae40280dbd6f33dc613ec3a;p=collectd.git Merge pull request #313 from tiwilliam/master Add two new options for the MySQL plugin --- f7818fbc069c641e1ae40280dbd6f33dc613ec3a diff --cc src/mysql.c index 6337ab4d,8b660a3c..a6b1e5e6 --- a/src/mysql.c +++ b/src/mysql.c @@@ -285,9 -300,10 +300,11 @@@ static MYSQL *getconnection (mysql_data static void set_host (mysql_database_t *db, char *buf, size_t buflen) { - if ((db->host == NULL) + if (db->alias) + sstrncpy (buf, db->alias, buflen); + else if ((db->host == NULL) || (strcmp ("", db->host) == 0) + || (strcmp ("127.0.0.1", db->host) == 0) || (strcmp ("localhost", db->host) == 0)) sstrncpy (buf, hostname_g, buflen); else