summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d0bf11d)
raw | patch | inline | side by side (parent: d0bf11d)
author | Jeremy Katz <jeremy@katzbox.net> | |
Wed, 25 Sep 2013 18:36:48 +0000 (14:36 -0400) | ||
committer | Jeremy Katz <jeremy@katzbox.net> | |
Thu, 26 Sep 2013 16:37:25 +0000 (12:37 -0400) |
The mysql and postgresql plugins have special handling if you
use localhost as your hostname. Sometimes you need to use 127.0.0.1
instead and want to not have that make changes to the hostname
for the metrics.
use localhost as your hostname. Sometimes you need to use 127.0.0.1
instead and want to not have that make changes to the hostname
for the metrics.
src/mysql.c | patch | blob | history | |
src/postgresql.c | patch | blob | history |
diff --git a/src/mysql.c b/src/mysql.c
index d15a055fe3296f70835e8e6daed68a46b37965bc..6337ab4d127802536fa078cc4342a085750fb7d0 100644 (file)
--- a/src/mysql.c
+++ b/src/mysql.c
{
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
diff --git a/src/postgresql.c b/src/postgresql.c
index 1eaf6bd3877570a56c0e50c045b7e90cc888cda2..16e539a0244d442e5cc473837cf02da7e72b7925 100644 (file)
--- a/src/postgresql.c
+++ b/src/postgresql.c
}
if (C_PSQL_IS_UNIX_DOMAIN_SOCKET (db->host)
+ || (0 == strcmp (db->host, "127.0.0.1"))
|| (0 == strcmp (db->host, "localhost")))
host = hostname_g;
else