Sha256: cfa3149a9e8d078f5dc84f5d3f564de05cd44726eb970e512e4ae6509d2abba3
Contents?: true
Size: 738 Bytes
Versions: 13
Compression:
Stored size: 738 Bytes
Contents
module Heartcheck module Checks class Firewall < Base def services super.map { |opts| Services::Firewall.new(opts) } end def validate services.each do |service| begin Net::Telnet.new(service.params) rescue Errno::ECONNREFUSED; nil rescue append_error(service) end end end private def custom_error(service) error_message = "connection refused on: #{service.host}:#{service.port}" if service.proxy proxy_uri = URI(service.proxy) error_message << " via proxy: #{proxy_uri.host}:#{proxy_uri.port}" end @errors << error_message end end end end
Version data entries
13 entries across 13 versions & 1 rubygems