Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ping a site in ruby?

What replacements are available for pinging an ip address in Ruby? The stdlib "ping" library seems to be pretty limited in functionality. I'm not interested in rolling my own code here. Are there good gems available? Should I just suck it up and live with it?

(I'm coding in Ruby 1.8.6 on Linux)

like image 964
salt.racer Avatar asked Dec 02 '08 00:12

salt.racer


1 Answers

net-ping is worth a look. It allows for TCP pings (like the standard ruby ping) but also UDP, HTTP, and ICMP pings. An ICMP ping requires root privileges but the others do not.

like image 144
Gordon Wilson Avatar answered Oct 20 '22 08:10

Gordon Wilson