DataScript: avi.pool.get_server_status


Function avi.pool.get_server_status(pool, server, port)
Description Determine the status of the server listening at a specified port.
Parameter All three parameter fields are required.

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

The server flag is the IPv4 (or, starting with 18.1.3, IPv6) address of the server, in quotes.

The port flag forwards the connection to a specific service port of the server. The port must be a number between 0 and 65536, or an expression that evaluates to a valid port number..

Returns Return value of 0 indicates the server is down. Return value of 1 indicates the server is up.
Example If a server is down, redirect traffic elsewhere.
if avi.pool.get_server_status("web-pool", "", "80") == 0 then
   avi.http.redirect("" .. avi.http.get_uri())