Reputation: 463
how to check the current status of server(up/down) from my rails application . If server become down,and many users are logined, I need to perform some actions.
Upvotes: 2
Views: 2120
Reputation: 1662
ping is really easy in ruby, maybe someone with some more rails experience can give more related info though.
require 'ping'
Ping.pingecho "www.google.com"
=> true
Ping can also take in a timeout default is 5 and a port.
Upvotes: 1