class ChkDFront::Troubleshoot

Contains all troubleshooting functionalities. Currently, ping, http, nslookup

Public Class Methods

dns_ping(host) click to toggle source
# File lib/chkdfront/troubleshoot.rb, line 14
def self.dns_ping(host)
  dns = Net::DNS::Resolver.start(host)
  dns.answer.select {|r| r.type == "CNAME"}&.map(&:cname)
rescue Exception => e
  puts e.message
  return []
end
http_ping(host) click to toggle source
# File lib/chkdfront/troubleshoot.rb, line 9
def self.http_ping(host)
  host = "http://#{host}" unless host.match(/^(http|https):\/\//i)
  Net::Ping::HTTP.new(host)
end
icmp_ping(host) click to toggle source
# File lib/chkdfront/troubleshoot.rb, line 5
def self.icmp_ping(host)
  Net::Ping::External.new(host)
end