Class: Heartcheck::Checks::Firewall
- Defined in:
- lib/heartcheck/checks/firewall.rb
Instance Attribute Summary
Attributes inherited from Base
#dev, #doc_url, #functional, #name, #timeout
Instance Method Summary collapse
Methods inherited from Base
#add_service, #check, #informations, #initialize, #inspect, #on_error, #register_dynamic_services, #to_validate
Constructor Details
This class inherits a constructor from Heartcheck::Checks::Base
Instance Method Details
#services ⇒ Object
4 5 6 |
# File 'lib/heartcheck/checks/firewall.rb', line 4 def services super.map { |opts| Services::Firewall.new(opts) } end |
#uri_info ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/heartcheck/checks/firewall.rb', line 19 def uri_info services.map do |s| { host: s.uri.host, port: s.uri.port, scheme: s.uri.scheme } end end |
#validate ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/heartcheck/checks/firewall.rb', line 8 def validate services.each do |service| begin Net::Telnet.new(service.params) rescue Errno::ECONNREFUSED; nil rescue append_error(service) end end end |