java.lang.Object
org.openhab.core.model.script.actions.Ping

public class Ping extends Object
This Action checks the vitality of the given host.
Author:
Thomas Eichstaedt-Engelen - Initial contribution, Kai Kreuzer - Initial contribution
  • Constructor Details

    • Ping

      public Ping()
  • Method Details

    • checkVitality

      public static boolean checkVitality(String host, int port, int timeout) throws IOException, SocketTimeoutException
      Checks the vitality of host. If port '0' is specified (which is the default when configuring just the host), a regular ping is issued. If other ports are specified we try open a new Socket with the given timeout.
      Parameters:
      host -
      port -
      timeout -
      Returns:
      true when host is reachable on port within the given timeout and false in all other cases.
      Throws:
      IOException
      SocketTimeoutException