diff --git a/bindings/java/org/collectd/java/GenericJMXConfConnection.java b/bindings/java/org/collectd/java/GenericJMXConfConnection.java
index 56fdd4e7f85b18f41bcc6a562685928a5b1e12c7..ea0f2fa2e54a1a3eabe7ca65517ac336c60ca40d 100644 (file)
import java.net.UnknownHostException;
import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.management.MalformedObjectNameException;
import javax.management.remote.JMXServiceURL;
import javax.management.remote.JMXConnector;
return (this._host);
}
- try
- {
- InetAddress localHost = InetAddress.getLocalHost();
- return (localHost.getHostName ());
- }
- catch (UnknownHostException e)
- {
- return ("localhost");
- }
+ return Collectd.getHostname();
} /* }}} String getHost */
private void connect () /* {{{ */