Os_slb:: get_server_current_connections($name), Example, Context – Brocade Virtual ADX OpenScript API Guide (Supporting ADX v03.1.00) User Manual

Page 105: Usage, Input parameters, Return values

Advertising
background image

Brocade Virtual ADX OpenScript API Guide

93

53-1003243-01

Methods

7

Example

OS_SLB:: get_server_current_connections($name)

Returns the number of current connections for the real server specified by $name.

Context

This function can be called from any event.

Usage

Can be used for monitoring purpose.

Input Parameters

The following table contains the input values.

Return Values

The following table contains the return values.

Example

TABLE 113

Input Values

Name

Type

Description

$name

string

The real server name.

TABLE 114

Return Values

Name

Type

Description

integer

The number of current
connection for the server
specified by $name.

use OS_SLB;

use OS_HTTP_REQUEST;

sub HTTP_REQUEST{

if(OS_SLB::is_server_up("server-name" => "rs1", "port" => 80) == 0)

{

print "Real server rs1 port 80 is down\n";

}

}

use OS_SLB;

use OS_HTTP_REQUEST;

sub HTTP_REQUEST{

my $connections = OS_SLB::get_server_current_connections("rs1");

print "The current connections of the server rs1 is: $connections\n";

}

Advertising