host-status.rb
def ping_list(list)
	list.each do |entry|
		# ping the host, if the host is online, reset counter
		# to 0. if the host is not online, add 1 to the counter
		if ping(entry[0])
			entry[1] = 0
		else
			entry[1] += 1
		end
		# if the host hasn't responded to two consecutive pings
		# call the outage handler
		if entry[1] == 2
			handle_outage(entry[0])
		end
	end
	# return the updated list for the next scheduled run
	return list
end
# 'list' is an array of hosts made from the initialize_list method
'list' is an array of hosts made from the initialize_list method
' list ' is an array of hosts made from the initialize_list method
def ping_list(list)
	list.each do |entry|
		if ping(entry[0])
			entry[1] = 0
		else
			entry[1] += 1
		end
		if entry[1] == 2
			handle_outage(entry[0])
		end
	end
	return list
end
def ping_list ( list ) list . each do | entry | if ping ( entry [ 0 ] ) entry [ 1 ] = 0 else entry [ 1 ] += 1 end if entry [ 1 ] == 2 handle_outage ( entry [ 0 ] ) end end return list end
'list' is an array of hosts made from the initialize_list method
' list ' is an array of hosts made from the initialize_list method
# ping the host, if the host is online, reset counter # to 0. if the host is not online, add 1 to the counter # if the host hasn't responded to two consecutive pings # call the outage handler # return the updated list for the next scheduled run
list