Bring in hostname as defined in the main configuration by default
[collectd.git] / bindings / java / org / collectd / java / GenericJMXConfConnection.java
index 99b140a..186d144 100644 (file)
@@ -86,15 +86,7 @@ class GenericJMXConfConnection
       return (this._host);
     }
 
-    try
-    {
-      InetAddress localHost = InetAddress.getLocalHost();
-      return (localHost.getHostName ());
-    }
-    catch (UnknownHostException e)
-    {
-      return ("localhost");
-    }
+    return Collectd.getHostname();
   } /* }}} String getHost */
 
 private void connect () /* {{{ */