class Pandur
To access configuration (and logging), just include this module to your class, and you can directly access all configuration and the logging.
class ExampleClass include Pandur::Config def some_method logger.debug(config('some_config')) end end
Constants
- VERSION
Public Class Methods
new(conf = {})
click to toggle source
# File lib/pandur.rb, line 11 def initialize(conf = {}) logger.level = conf[:log_level] || Logger::ERROR load_config(conf[:config_file] || '~/.pandur.yaml') end
Public Instance Methods
run(conf = {})
click to toggle source
# File lib/pandur.rb, line 16 def run(conf = {}) logger.debug("running ..") config('hosts').each do |host| check(host) end logger.debug(".. finished") end
Private Instance Methods
check(target)
click to toggle source
# File lib/pandur.rb, line 26 def check(target) Pandur::Host.new(target).check rescue Net::SSH::AuthenticationFailed puts "Failed to connect: #{$!.message}" end