check-ping.rb: Try ping multiple times

This patch modifies `check-ping.rb` so that it can try ping multiple times and check the successful ratio rather than single ping result.