Check if a port of a server is active, measure response time
is_up() checks if a web server is up.
ping_port(
destination,
port = 80L,
continuous = FALSE,
verbose = continuous,
count = 3L,
timeout = 1
)
is_up(
destination,
port = 80,
timeout = 0.5,
fail_on_dns_error = FALSE,
check_online = TRUE
)Host name or IP address.
Port.
Logical, whether to keep pinging until the user interrupts.
Whether to print progress on the screen while pinging.
Number of pings to perform.
Timeout, in seconds. How long to wait for a ping to succeed.
If TRUE then is_up() fails if the DNS
resolution fails. Otherwise it will return FALSE.
Whether to check first if the computer is online.
Otherwise it is possible that the computer is behind a proxy, that
hijacks the HTTP connection to destination.
Vector of response times, in milliseconds.
NA means no response within the timeout.
ping_port("r-project.org")
#> [1] 121.840 121.445 123.178
is_up("google.com")
#> [1] TRUE
is_up("google.com", timeout = 0.01)
#> [1] FALSE