Class: Fuey::Inspections::Ping
Instance Attribute Summary collapse
Attributes inherited from Inspection
#name, #state
Instance Method Summary
collapse
Methods inherited from Inspection
#failed?, #notify, #passed?
#initialize
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
6
7
8
|
# File 'lib/fuey_client/fuey/inspections/ping.rb', line 6
def host
@host
end
|
#result ⇒ Object
Returns the value of attribute result.
6
7
8
|
# File 'lib/fuey_client/fuey/inspections/ping.rb', line 6
def result
@result
end
|
Instance Method Details
#_execute ⇒ Object
8
9
10
11
12
13
14
15
|
# File 'lib/fuey_client/fuey/inspections/ping.rb', line 8
def _execute
result = Net::Ping::External.new(@host).ping
if result
self.pass
else
self.fail
end
end
|
#status ⇒ Object
21
22
23
24
25
26
|
# File 'lib/fuey_client/fuey/inspections/ping.rb', line 21
def status
{
:settings => host || "",
:statusMessage => %(#{state} ping for #{host}),
}.merge(super)
end
|
#to_s ⇒ Object
17
18
19
|
# File 'lib/fuey_client/fuey/inspections/ping.rb', line 17
def to_s
%(Ping #{name} #{host})
end
|