Module: Aua::Agents::HttpChecker

Defined in:
lib/aua/agents/http_checker.rb

Constant Summary collapse

KNOWN_CLIENTS =
%w(check_http NewRelicPinger W3C_Validator FeedValidator)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extend?(agent) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
8
# File 'lib/aua/agents/http_checker.rb', line 4

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

Instance Method Details

#nameObject



14
15
16
17
18
19
20
# File 'lib/aua/agents/http_checker.rb', line 14

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

#typeObject



10
11
12
# File 'lib/aua/agents/http_checker.rb', line 10

def type
  :HttpChecker
end

#versionObject



22
23
24
25
26
27
# File 'lib/aua/agents/http_checker.rb', line 22

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