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?, #status
#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
|
#settings ⇒ Object
21
22
23
|
# File 'lib/fuey_client/fuey/inspections/ping.rb', line 21
def settings
host || ""
end
|
#status_message ⇒ Object
25
26
27
|
# File 'lib/fuey_client/fuey/inspections/ping.rb', line 25
def status_message
%(#{state} ping for #{host})
end
|
#to_s ⇒ Object
17
18
19
|
# File 'lib/fuey_client/fuey/inspections/ping.rb', line 17
def to_s
%(Ping #{name} #{host})
end
|