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.
{
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
}
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