Merge pull request #313 from tiwilliam/master
authorPierre-Yves Ritschard <pyr@spootnik.org>
Tue, 29 Jul 2014 15:06:20 +0000 (17:06 +0200)
committerPierre-Yves Ritschard <pyr@spootnik.org>
Tue, 29 Jul 2014 15:06:20 +0000 (17:06 +0200)
Add two new options for the MySQL plugin

1  2 
src/collectd.conf.in
src/collectd.conf.pod
src/mysql.c

Simple merge
Simple merge
diff --cc 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