Class: Heartcheck::Checks::Firewall

Inherits:
Base
  • Object
show all
Defined in:
lib/heartcheck/checks/firewall.rb

Instance Attribute Summary

Attributes inherited from Base

#dev, #functional, #name, #timeout

Instance Method Summary collapse

Methods inherited from Base

#add_service, #check, #informations, #initialize, #on_error, #register_dynamic_services, #to_validate

Constructor Details

This class inherits a constructor from Heartcheck::Checks::Base

Instance Method Details

#servicesObject


4
5
6
# File 'lib/heartcheck/checks/firewall.rb', line 4

def services
  super.map { |opts| Services::Firewall.new(opts) }
end

#validateObject


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