java.lang.Object
org.sentrysoftware.metricshub.engine.common.helpers.NetworkHelper

public class NetworkHelper extends Object
Helper class to retrieve network information.
  • Method Details

    • isLocalhost

      public static boolean isLocalhost(String hostname)
      Check whether the given hostname is a localhost.
      Parameters:
      hostname - The hostname to check.
      Returns:
      true if the hostname is a localhost, false otherwise.
    • resolveDns

      public static String resolveDns(String hostname)
      Resolve the IP address of the given hostname.
      Parameters:
      hostname - The hostname.
      Returns:
      The IP address of the hostname, or null if not resolved.
    • getFqdn

      public static String getFqdn(String hostname)
      Get the fully qualified domain name (FQDN) of the given hostname.
      Parameters:
      hostname - The hostname.
      Returns:
      The FQDN of the hostname, or the original hostname if not resolved.