Class: Pandur::Host

Inherits:
Object
  • Object
show all
Includes:
Config
Defined in:
lib/pandur/host.rb

Instance Method Summary collapse

Methods included from Config

#config, #load_config, #logger

Constructor Details

#initialize(target) ⇒ Host

Returns a new instance of Host.



8
9
10
# File 'lib/pandur/host.rb', line 8

def initialize(target)
  @config = target
end

Instance Method Details

#checkObject



12
13
14
15
16
17
18
19
20
# File 'lib/pandur/host.rb', line 12

def check
  logger.debug("Connecting to #{@config['username']}@#{@config['hostname']}")
  Net::SSH.start(@config['hostname'], @config['username'],
                 :password => @config['password']) do |ssh|
    @config['check'].each do |check|
      Pandur::Check.new(check).check(ssh)
    end
  end
end