public String getLocalNodeIPAddress() {
    if (nodeIPAddress == null) {
      try {
        nodeIPAddress = InetAddress.getLocalHost().getHostAddress();
      } catch (Exception e) {
        if (DEBUG)
          logger.info("Error during getLocalNodeIPAddress: " + e.toString());
      }
    }
    if (nodeIPAddress == null)
      nodeIPAddress = "127.0.0.1";
    return nodeIPAddress;
  }
This class stores published metrics to the SQL Server database.
contrib/ambari-scom/metrics-sink/src/main/java/org/apache/hadoop/metrics2/sink/SqlSink.java