Module: DNSCheck::Node
Instance Method Summary collapse
- #hostname ⇒ Object
- #output ⇒ Object
- #resolv ⇒ Object
- #resolv_all ⇒ Object
- #start ⇒ Object
- #timeout ⇒ Object
Methods included from Core
Instance Method Details
#hostname ⇒ Object
21 22 23 |
# File 'lib/dns-check/node.rb', line 21 def hostname DNSCheck.config[:hostname] end |
#output ⇒ Object
29 30 31 |
# File 'lib/dns-check/node.rb', line 29 def output output ||= Output.new end |
#resolv ⇒ Object
17 18 19 |
# File 'lib/dns-check/node.rb', line 17 def resolv DNSCheck end |
#resolv_all ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/dns-check/node.rb', line 33 def resolv_all resolv.timeout = timeout EM.run do Fiber.new do @records.each do |e, ns, c| resolv.nameservers = ns resolved_ip = resolv.lookup(hostname) output_msg = [e, resolved_ip, ns.sample, c] output.insert do output.print_msg output_msg end end EM.stop end.resume end end |