Sha256: aaa1c03ef2ae8b344b2f4ab5b235fd524bb252324906cfc4fdb277721a404012

Contents?: true

Size: 599 Bytes

Versions: 7

Compression:

Stored size: 599 Bytes

Contents

module Aua::Agents::HttpChecker
  KNOWN_CLIENTS = %w(check_http NewRelicPinger W3C_Validator FeedValidator)

  def self.extend?(agent)
    agent.app &&
    (KNOWN_CLIENTS.include?(agent.app) ||
    agent.app =~ /Pingdom\.com_bot_version_/)
  end

  def type
    :HttpChecker
  end

  def name
    @name ||= begin
      return :PingdomBot if app =~ /Pingdom\.com_bot_version_([\d\.]+)/
      return :Nagios if app == "check_http"
      app.to_sym
    end
  end

  def version
    @version ||= begin
      return $1 if app =~ /Pingdom\.com_bot_version_([\d\.]+)/
      versions.first
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
aua-0.3.2 lib/aua/agents/http_checker.rb
aua-0.3.1 lib/aua/agents/http_checker.rb
aua-0.3.0 lib/aua/agents/http_checker.rb
aua-0.2.6 lib/aua/agents/http_checker.rb
aua-0.2.5 lib/aua/agents/http_checker.rb
aua-0.2.4 lib/aua/agents/http_checker.rb
aua-0.2.3 lib/aua/agents/http_checker.rb