Check if a Remote Computer is Up

Check if a remote computer is up. It can either just call the system ping command, or check a specified TCP port.


Linux Build Status Windows Build status CRAN RStudio mirror downloads

The pingr package is a simple utility that can be used to check if a remote machine is running, by sending network packets to it. It is similar to the command line ping program, in fact for ICMP packages it just calls ping.

ICMP ping

The ping() function does ICMP ping, via the system's ping utility:

library(pingr)
ping("127.0.0.1")
#> [1] 0.055 0.061 0.123

By default it sends three packets and measures the time it receives and answer. It waits between sending out the packets, so if you want a really quick check, you can just send a single packet:

ping("127.0.0.1", count = 1)
#> [1] 0.046

If a machine is down (or it does not exist), then NA is returned instead of the roundtrip time:

ping("192.0.2.1", count = 1)
#> [1] NA

TCP ping

With TCP ping we can check if a machine is listeing on a TCP port, e.g. if google's search web server is up and running:

ping_port("www.google.com", port = 80, count = 1)
#> [1] 78.884

News

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("pingr")

2.0.0 by Gábor Csárdi, a month ago


https://github.com/r-lib/pingr#readme


Report a bug at https://github.com/r-lib/pingr/issues


Browse source code at https://github.com/cran/pingr


Authors: Gábor Csárdi [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports processx, utils

Suggests covr, testthat


Imported by codemetar, cymruservices, hydroscoper, shinytest.

Suggested by callr, devtools, fgeo.tool, gh, pak, pkgcache, pkgsearch, ps, remotes, wdpar, webdriver.


See at CRAN