开发者

how to check the current status of server(up/down) from my rails application

开发者 https://www.devze.com 2023-01-06 22:20 出处:网络
how to check the curre开发者_开发技巧nt status of server(up/down) from my rails application . If server become down,and many users are logined, I need to perform some actions.ping is really easy in ru

how to check the curre开发者_开发技巧nt status of server(up/down) from my rails application . If server become down,and many users are logined, I need to perform some actions.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消