DataScript: avi.pool.get_active_server_list

DataScript

Function avi.pool.get_active_server_list( pool )

Description

Determine the number of servers with up status.

Events

HTTP_REQ
HTTP_RESP

Parameter

pool can be a specific pool name or an expression that evaluates to a valid pool name.

Returns

A table with the IP addresses of all active servers in the pool.

Example

Print active servers and total count.

active_srvr_list = avi.pool.get_active_server_list('pool-1')
count = 0
for index, server in ipairs(active_srvr_list) do
	avi.vs.log(tostring(index)..". "..server)
	count = count + 1
end
avi.vs.log("Total active servers = ".. tostring(count))